fake_velocity.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 import rospy
5 from geometry_msgs.msg import Quaternion
6 from amr_interop_msgs.msg import Velocity
7 
8 if __name__ == "__main__":
9  rospy.init_node("fake_velocity")
10 
11  pub = rospy.Publisher("velocity", Velocity, queue_size=1)
12  linear = rospy.get_param("~linear", 0.0)
13  angular_x = rospy.get_param("~angular_x", float("nan"))
14  angular_y = rospy.get_param("~angular_y", float("nan"))
15  angular_z = rospy.get_param("~angular_z", float("nan"))
16  angular_w = rospy.get_param("~angular_w", float("nan"))
17  publish_rate = rospy.get_param("~publish_rate", 1)
18 
19  loop_rate = rospy.Rate(publish_rate)
20  velocity_msg = Velocity()
21  velocity_msg.linear = linear
22  velocity_msg.angular = Quaternion()
23  velocity_msg.angular.x = angular_x
24  velocity_msg.angular.y = angular_y
25  velocity_msg.angular.z = angular_z
26  velocity_msg.angular.w = angular_w
27  while not rospy.is_shutdown():
28  pub.publish(velocity_msg)
29  loop_rate.sleep()


amr_interop_bridge
Author(s):
autogenerated on Tue Mar 1 2022 23:45:33