From b80dc45e690f1e637f361356a46e70f937e9989f Mon Sep 17 00:00:00 2001 From: ohwi Date: Sat, 13 Jul 2019 01:28:18 +0900 Subject: [PATCH] Test --- scripts/envs/open_manipulator/ros_interface.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/envs/open_manipulator/ros_interface.py b/scripts/envs/open_manipulator/ros_interface.py index a7faa00..3555481 100755 --- a/scripts/envs/open_manipulator/ros_interface.py +++ b/scripts/envs/open_manipulator/ros_interface.py @@ -10,7 +10,8 @@ import rospy # noqa import tf # noqa import tf.transformations as tr # noqa from gazebo_msgs.srv import DeleteModel, GetModelState, SpawnModel # noqa -from gazebo_msgs.srv import GetLinkProperties, SetLinkProperties, SetJointPropertiesRequest +from gazebo_msgs.srv import GetJointProperties, SetJointProperties +from gazebo_msgs.srv import GetJointPropertiesRequest, SetJointPropertiesRequest from geometry_msgs.msg import Pose from open_manipulator_msgs.msg import KinematicsPose, OpenManipulatorState from pykdl_utils.kdl_kinematics import KDLKinematics @@ -380,10 +381,11 @@ class OpenManipulatorRosGazeboInterface(OpenManipulatorRosBaseInterface): def __init__(self, cfg): rospy.init_node("OpenManipulatorRosGazeboInterface") super(OpenManipulatorRosGazeboInterface, self).__init__(cfg) - self.get_link_properties = rospy.ServiceProxy('/gazebo/get_link_properties', GetLinkProperties) - self.set_link_properties = rospy.ServiceProxy('/gazebo/set_link_properties', SetLinkProperties) + self.get_joint_properties = rospy.ServiceProxy('/gazebo/get_joint_properties', GetJointProperties) + self.set_joint_properties = rospy.ServiceProxy('/gazebo/set_joint_properties', SetJointProperties) - print(self.robot.joints) + print([j.name for j in self.robot.joints]) + print(self.get_joint_properties(GetJointPropertiesRequest('joint1'))) def reset_gazebo_world(self, block_pose=None): """Initialize randomly the state of robot agent and surrounding envs (including target obj.)."""