35 from moveit_commander
import MoveGroupCommander
36 from .exception
import MoveItCommanderException
37 from moveit_ros_planning_interface
import _moveit_robot_interface
38 from moveit_msgs.msg
import RobotState
39 from visualization_msgs.msg
import MarkerArray
54 @return number of the list that _Joint__get_joint_limits
56 @see: http://docs.ros.org/indigo/api/moveit_core/html/classmoveit_1_1core_1_1JointModel.html#details
57 for more about variable.
63 @return: Either a single list of min and max joint limits, or
64 a set of those lists, depending on the number of variables
65 available in this joint.
75 @return: Either a single min joint limit value, or
76 a set of min values, depending on the number of variables
77 available in this joint.
83 return [l[0]
for l
in limits]
87 @return: Either a single max joint limit value, or
88 a set of max values, depending on the number of variables
89 available in this joint.
95 return [l[1]
for l
in limits]
101 (Editor's comment by @130s) I doubt there's a case where this method goes into
102 "else" block, because get_current_joint_values always return a single list.
104 cf. getCurrentJointValues https://github.com/moveit/moveit_ros/blob/8e819dda2b19462b8d0c5aacc69706c8a9d8d883/planning_interface/robot_interface/src/wrap_python_robot_interface.cpp#L176
106 vals = self.
_robot._r.get_current_joint_values(self.
_name)
112 def move(self, position, wait=True):
114 @param position [float]: List of joint angles to achieve.
115 @param wait bool: If false, the commands gets operated asynchronously.
120 "There is no known group containing joint %s. Cannot move."
125 gc.set_joint_value_target(gc.get_current_joint_values())
126 gc.set_joint_value_target(self.
_name, position)
132 @return: A list of length of 2 that contains max and min positional
133 limits of the specified joint.
147 @rtype: geometry_msgs.Pose
149 return conversions.list_to_pose_stamped(
154 def __init__(self, robot_description="robot_description", ns=""):
157 self.
_r = _moveit_robot_interface.RobotInterface(robot_description, ns)
163 Get the frame of reference in which planning is done (and environment
169 """Get a MarkerArray of the markers that make up this robot
172 (): get's all markers for current state
173 state (RobotState): gets markers for a particular state
174 values (dict): get markers with given values
175 values, links (dict, list): get markers with given values and these links
176 group (string): get all markers for a group
177 group, values (string, dict): get all markers for a group with desired values
183 if isinstance(args[0], RobotState):
184 msg_str = conversions.msg_to_string(args[0])
186 elif isinstance(args[0], dict):
188 elif isinstance(args[0], str):
189 conversions.msg_from_string(mrkr, self.
_r.get_group_markers(*args))
195 """Get the name of the root link of the robot model"""
196 return self.
_r.get_robot_root_link()
200 Get the names of all the movable joints that make up a group.
201 If no group name is specified, all joints in the robot model are returned.
202 Excludes fixed and mimic joints.
204 if group
is not None:
206 return self.
_r.get_group_active_joint_names(group)
214 Get the names of all the movable joints that make up a group.
215 If no group name is specified, all joints in the robot model are returned.
216 Includes fixed and mimic joints.
218 if group
is not None:
220 return self.
_r.get_group_joint_names(group)
228 Get the links that make up a group. If no group name is specified,
229 all the links in the robot model are returned.
231 if group
is not None:
233 return self.
_r.get_group_link_names(group)
240 """Get the names of the groups defined for the robot"""
244 """Get a RobotState message describing the current state of the robot"""
251 Get a dictionary mapping variable names to values.
252 Note that a joint may consist of one or more variables.
258 @param name str: Name of movegroup
259 @rtype: moveit_commander.robot.Joint
260 @raise exception: MoveItCommanderException
263 return self.
Joint(self, name)
269 @param name str: Name of movegroup
270 @rtype: moveit_commander.robot.Link
271 @raise exception: MoveItCommanderException
274 return self.
Link(self, name)
280 @param name str: Name of movegroup
281 @rtype: moveit_commander.MoveGroupCommander
293 @param name str: Name of movegroup
300 Get the name of the smallest group (fewest joints) that includes
301 the joint name specified as argument.
319 We catch the names of groups, joints and links to allow easy access
325 return self.
Joint(self, name)
327 return self.
Link(self, name)
329 return object.__getattribute__(self, name)