gazebo_robot_kinematics_mode.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import rospy
00004 import math
00005 from geometry_msgs.msg import *
00006 from nav_msgs.msg import *
00007 from gazebo_msgs.msg import *
00008 from gazebo_msgs.srv import *
00009 import tf
00010 
00011 def gazebo_robot_kinematics_mode_main():
00012     global robot_pose_pub
00013     rospy.wait_for_service('/gazebo/set_physics_properties')
00014     set_physics_properties_srv = rospy.ServiceProxy('/gazebo/set_physics_properties', SetPhysicsProperties)
00015     get_physics_properties_srv = rospy.ServiceProxy('/gazebo/get_physics_properties', GetPhysicsProperties)
00016     current_physics_properties = get_physics_properties_srv()
00017     set_physics_properties_srv(time_step=current_physics_properties.time_step,
00018                                max_update_rate=current_physics_properties.max_update_rate,
00019                                gravity=current_physics_properties.gravity,
00020                                ode_config=current_physics_properties.ode_config)
00021     rospy.Subscriber('/odom', Odometry, odom_cb)
00022     robot_pose_pub = rospy.Publisher('/ROBOT/SetVelPlugin/PoseCommand', Pose)
00023 
00024 def odom_cb(msg):
00025     robot_pose_pub.publish(msg.pose.pose)
00026 
00027 if __name__ == '__main__':
00028     rospy.init_node('gazebo_robot_kinematics_mode')
00029     gazebo_robot_kinematics_mode_main()
00030     rospy.spin()


hrpsys_gazebo_general
Author(s): Yohei Kakiuchi , Kei Okada , Masaki Murooka
autogenerated on Thu Jun 6 2019 20:56:53