test_publisher_twist.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004 #
00005 # Licensed under the Apache License, Version 2.0 (the "License");
00006 # you may not use this file except in compliance with the License.
00007 # You may obtain a copy of the License at
00008 #
00009 #   http://www.apache.org/licenses/LICENSE-2.0
00010 #
00011 # Unless required by applicable law or agreed to in writing, software
00012 # distributed under the License is distributed on an "AS IS" BASIS,
00013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 # See the License for the specific language governing permissions and
00015 # limitations under the License.
00016 
00017 
00018 import rospy
00019 import math
00020 from geometry_msgs.msg import Twist
00021 
00022 def twistPub():
00023   rospy.init_node("test_publisher_twist", anonymous=True)
00024 
00025   pub = rospy.Publisher("twist_controller/command_twist", Twist, queue_size=1)
00026   twist_msg =  Twist()
00027 
00028   twist_msg.linear.x = 0
00029   twist_msg.linear.y = -0.05
00030   twist_msg.linear.z = 0
00031   twist_msg.angular.x = 0
00032   twist_msg.angular.y = 0
00033   twist_msg.angular.z = 0
00034 
00035   r = rospy.Rate(50)
00036 
00037   while not rospy.is_shutdown():
00038     pub.publish(twist_msg)
00039     r.sleep()
00040 
00041 if __name__ == '__main__':
00042   try:
00043       twistPub()
00044   except rospy.ROSInterruptException: pass


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Jun 6 2019 21:19:26