32 from geometry_msgs.msg
import Twist
35 pub.publish(twist_output)
40 opposite_twist = Twist()
41 opposite_twist.linear.x = -twist.linear.x
42 opposite_twist.linear.y = -twist.linear.y
43 opposite_twist.angular.z = -twist.angular.z
45 if rospy.is_shutdown():
50 twist_output = zero_twist
52 twist_output = opposite_twist
54 twist_output = zero_twist
59 pub = rospy.Publisher(
'/mobility_base/cmd_vel', Twist, queue_size=1)
60 rospy.init_node(
'motion_demo');
64 zero_twist.linear.x = 0
65 zero_twist.linear.y = 0
66 zero_twist.angular.z = 0
69 twist_output = Twist()
71 rospy.Timer(rospy.Duration(0.1), timer_callback)
90 vel.linear.x = 0.707 * speed
91 vel.linear.y = -0.707 * speed
102 vel.linear.x = -0.707 * speed
103 vel.linear.y = -0.707 * speed
108 vel.linear.x = -speed
114 vel.linear.x = -0.707 * speed
115 vel.linear.y = 0.707 * speed
126 vel.linear.x = 0.707 * speed
127 vel.linear.y = 0.707 * speed
131 if __name__ ==
'__main__':
def simple_motion(twist, duration)
def timer_callback(event)