fake_mir_joint_publisher.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 # Copyright (c) 2018-2022, Martin Günther (DFKI GmbH) and contributors
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
6 #
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 #
10 # * Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 #
14 # * Neither the name of the copyright holder nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 # POSSIBILITY OF SUCH DAMAGE.
29 #
30 # Author: Martin Günther
31 
32 import rospy
33 from sensor_msgs.msg import JointState
34 
35 
37  rospy.init_node('fake_mir_joint_publisher')
38  prefix = rospy.get_param('~prefix', '')
39  pub = rospy.Publisher('joint_states', JointState, queue_size=10)
40  r = rospy.Rate(50.0)
41  while not rospy.is_shutdown():
42  js = JointState()
43  js.header.stamp = rospy.Time.now()
44  js.name = [
45  prefix + 'left_wheel_joint',
46  prefix + 'right_wheel_joint',
47  prefix + 'fl_caster_rotation_joint',
48  prefix + 'fl_caster_wheel_joint',
49  prefix + 'fr_caster_rotation_joint',
50  prefix + 'fr_caster_wheel_joint',
51  prefix + 'bl_caster_rotation_joint',
52  prefix + 'bl_caster_wheel_joint',
53  prefix + 'br_caster_rotation_joint',
54  prefix + 'br_caster_wheel_joint',
55  ]
56  js.position = [0.0 for _ in js.name]
57  js.velocity = [0.0 for _ in js.name]
58  js.effort = [0.0 for _ in js.name]
59  pub.publish(js)
60  r.sleep()
61 
62 
63 if __name__ == '__main__':
64  try:
66  except rospy.ROSInterruptException:
67  pass
fake_mir_joint_publisher
Definition: fake_mir_joint_publisher.py:1
fake_mir_joint_publisher.fake_mir_joint_publisher
def fake_mir_joint_publisher()
Definition: fake_mir_joint_publisher.py:36


mir_driver
Author(s): Martin Günther
autogenerated on Wed Nov 13 2024 03:34:54