35 from moveit_commander
import MoveGroupCommander, MoveItCommanderException
36 from moveit_ros_planning_interface
import _moveit_robot_interface
37 from moveit_msgs.msg
import RobotState
38 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/ros-planning/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. 117 group = self._robot.get_default_owner_group(self.
name())
119 raise MoveItCommanderException(
"There is no known group containing joint %s. Cannot move." % self.
_name)
120 gc = self._robot.get_group(group)
122 gc.set_joint_value_target(gc.get_current_joint_values())
123 gc.set_joint_value_target(self.
_name, position)
129 @return: A list of length of 2 that contains max and min positional 130 limits of the specified joint. 132 return self._robot._r.get_joint_limits(self.
_name)
144 @rtype: geometry_msgs.Pose 146 return conversions.list_to_pose_stamped(self._robot._r.get_link_pose(self.
_name), self._robot.get_planning_frame())
148 def __init__(self, robot_description="robot_description", ns=""):
151 self.
_r = _moveit_robot_interface.RobotInterface(robot_description, ns)
157 Get the frame of reference in which planning is done (and environment 160 return self._r.get_planning_frame()
163 """Get a MarkerArray of the markers that make up this robot 166 (): get's all markers for current state 167 state (RobotState): gets markers for a particular state 168 values (dict): get markers with given values 169 values, links (dict, list): get markers with given values and these links 170 group (string): get all markers for a group 171 group, values (string, dict): get all markers for a group with desired values 175 conversions.msg_from_string(mrkr, self._r.get_robot_markers())
177 if isinstance(args[0], RobotState):
178 msg_str = conversions.msg_to_string(args[0])
179 conversions.msg_from_string(mrkr, self._r.get_robot_markers(msg_str))
180 elif isinstance(args[0], dict):
181 conversions.msg_from_string(mrkr, self._r.get_robot_markers(*args))
182 elif isinstance(args[0], str):
183 conversions.msg_from_string(mrkr, self._r.get_group_markers(*args))
185 raise MoveItCommanderException(
"Unexpected type")
189 """Get the name of the root link of the robot model """ 190 return self._r.get_robot_root_link()
194 Get the names of all the movable joints that make up a group 195 (mimic joints and fixed joints are excluded). If no group name is 196 specified, all joints in the robot model are returned, including 197 fixed and mimic joints. 199 if group
is not None:
201 return self._r.get_group_joint_names(group)
203 raise MoveItCommanderException(
"There is no group named %s" % group)
205 return self._r.get_joint_names()
209 Get the links that make up a group. If no group name is specified, 210 all the links in the robot model are returned. 212 if group
is not None:
214 return self._r.get_group_link_names(group)
216 raise MoveItCommanderException(
"There is no group named %s" % group)
218 return self._r.get_link_names()
221 """Get the names of the groups defined for the robot""" 222 return self._r.get_group_names()
225 """ Get a RobotState message describing the current state of the robot""" 227 s.deserialize(self._r.get_current_state())
232 Get a dictionary mapping variable names to values. 233 Note that a joint may consist of one or more variables. 235 return self._r.get_current_variable_values()
239 @param name str: Name of movegroup 240 @rtype: moveit_commander.robot.Joint 241 @raise exception: MoveItCommanderException 244 return self.
Joint(self, name)
246 raise MoveItCommanderException(
"There is no joint named %s" % name)
250 @param name str: Name of movegroup 251 @rtype: moveit_commander.robot.Link 252 @raise exception: MoveItCommanderException 255 return self.
Link(self, name)
257 raise MoveItCommanderException(
"There is no link named %s" % name)
261 @param name str: Name of movegroup 262 @rtype: moveit_commander.MoveGroupCommander 264 if not self._groups.has_key(name):
266 raise MoveItCommanderException(
"There is no group named %s" % name)
272 @param name str: Name of movegroup 275 return self._r.has_group(name)
279 Get the name of the smallest group (fewest joints) that includes 280 the joint name specified as argument. 282 if not self._joint_owner_groups.has_key(joint_name):
296 We catch the names of groups, joints and links to allow easy access 302 return self.
Joint(self, name)
304 return self.
Link(self, name)
306 return object.__getattribute__(self, name)
def get_planning_frame(self)
def get_robot_markers(self, args)
def get_group_names(self)
def get_default_owner_group(self, joint_name)
def get_group(self, name)
def __init__(self, robot_description="robot_description", ns="")
def __init__(self, robot, name)
def __init__(self, robot, name)
def get_current_variable_values(self)
def __get_joint_limits(self)
def get_joint(self, name)
def get_link_names(self, group=None)
def __getattr__(self, name)
def has_group(self, name)
def get_current_state(self)
def get_joint_names(self, group=None)
def move(self, position, wait=True)