def initial_setup():
""" Prepares the Gazebo world for generating training data.
In particular, this routine turns off gravity, so that the objects
spawned in front of the RGBD camera will not fall. It also deletes
the ground plane, so that the only depth points produce will
correspond to the object of interest (eliminating the need for
clustering and segmentation as part of the trianing process)
Args: None
Returns: None
"""
rospy.wait_for_service('gazebo/get_model_state')
rospy.wait_for_service('gazebo/set_model_state')
rospy.wait_for_service('gazebo/get_physics_properties')
rospy.wait_for_service('gazebo/set_physics_properties')
rospy.wait_for_service('gazebo/spawn_sdf_model')
get_physics_properties_prox = rospy.ServiceProxy('gazebo/get_physics_properties', GetPhysicsProperties)
physics_properties = get_physics_properties_prox()
physics_properties.gravity.z = 0
set_physics_properties_prox = rospy.ServiceProxy('gazebo/set_physics_properties', SetPhysicsProperties)
set_physics_properties_prox(physics_properties.time_step,
physics_properties.max_update_rate,
physics_properties.gravity,
physics_properties.ode_config)
delete_model_prox = rospy.ServiceProxy('gazebo/delete_model', DeleteModel)
delete_model_prox('ground_plane')
training_helper.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录