test_publisher_twist_stamped.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 
18 import rospy
19 import math
20 from geometry_msgs.msg import TwistStamped
21 
22 def twistPub():
23  rospy.init_node("test_publisher_twist_stamped", anonymous=True)
24 
25  pub = rospy.Publisher("twist_controller/command_twist_stamped", TwistStamped, queue_size=1)
26  twist_stamped_msg = TwistStamped()
27 
28  #twist_stamped_msg.header.frame_id = "arm_left_base_link"
29  #twist_stamped_msg.header.frame_id = "arm_left_7_link"
30  twist_stamped_msg.header.frame_id = "odom_combined"
31  twist_stamped_msg.twist.linear.x = 0
32  twist_stamped_msg.twist.linear.y = 0
33  twist_stamped_msg.twist.linear.z = 0
34  twist_stamped_msg.twist.angular.x = 0
35  twist_stamped_msg.twist.angular.y = 0
36  twist_stamped_msg.twist.angular.z = 0
37 
38  r = rospy.Rate(50)
39 
40  while not rospy.is_shutdown():
41  twist_stamped_msg.header.stamp = rospy.Time.now()
42  pub.publish(twist_stamped_msg)
43  r.sleep()
44 
45 if __name__ == '__main__':
46  try:
47  twistPub()
48  except rospy.ROSInterruptException: pass


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Apr 8 2021 02:40:01