15 from nav_msgs.msg
import Odometry
16 from geometry_msgs.msg
import Pose, Quaternion, Point
20 rospy.init_node(
'fake_odom')
21 base_frame_id = rospy.get_param(
"~base_frame_id",
"base_link")
22 odom_frame_id = rospy.get_param(
"~odom_frame_id",
"odom")
23 publish_frequency = rospy.get_param(
"~publish_frequency", 10.0)
24 pub = rospy.Publisher(
'odom', Odometry)
25 tf_pub = tf.TransformBroadcaster()
28 quat = tf.transformations.quaternion_from_euler(0, 0, 0)
31 odom.header.frame_id = odom_frame_id
32 odom.pose.pose = Pose(Point(0, 0, 0), Quaternion(*quat))
34 rospy.loginfo(
"Publishing static odometry from \"%s\" to \"%s\"", odom_frame_id, base_frame_id)
35 r = rospy.Rate(publish_frequency)
36 while not rospy.is_shutdown():
37 odom.header.stamp = rospy.Time.now()
39 tf_pub.sendTransform((0, 0, 0), quat,
40 odom.header.stamp, base_frame_id, odom_frame_id)
43 if __name__ ==
'__main__':
46 except rospy.ROSInterruptException: