diff --git a/.setup_assistant b/.setup_assistant index 3b10d959518a12ccad29c4f35cc8506ab4e7c8d1..c92002e8a2137c789c25817d260fb97b9652eb89 100644 --- a/.setup_assistant +++ b/.setup_assistant @@ -4,7 +4,7 @@ moveit_setup_assistant_config: relative_path: robots/panda_arm.urdf.xacro xacro_args: hand:=true SRDF: - relative_path: config/panda.srdf + relative_path: config/panda.srdf.xacro CONFIG: author_name: MoveIt maintainer team author_email: moveit_releasers@googlegroups.com diff --git a/config/hand.xacro b/config/hand.xacro new file mode 100644 index 0000000000000000000000000000000000000000..a44fb07838b063a7fd7d881288ab4b57acaed05a --- /dev/null +++ b/config/hand.xacro @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="panda"> + <xacro:macro name="hand"> + <!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc--> + <!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included--> + <!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included--> + <!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group--> + <!--SUBGROUPS: Groups can also be formed by referencing to already defined group names--> + <group name="hand"> + <link name="panda_hand"/> + <link name="panda_leftfinger"/> + <link name="panda_rightfinger"/> + </group> + <!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'--> + <group_state name="open" group="hand"> + <joint name="panda_finger_joint1" value="0.035"/> + <joint name="panda_finger_joint2" value="0.035"/> + </group_state> + <group_state name="close" group="hand"> + <joint name="panda_finger_joint1" value="0"/> + <joint name="panda_finger_joint2" value="0"/> + </group_state> + <!--END EFFECTOR: Purpose: Represent information about an end effector.--> + <!--VIRTUAL JOINT: Purpose: this element defines a virtual joint between a robot link and an external frame of reference (considered fixed with respect to the robot)--> + <!--PASSIVE JOINT: Purpose: this element is used to mark joints that are not actuated--> + <!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. --> + <disable_collisions link1="panda_hand" link2="panda_leftfinger" reason="Adjacent"/> + <disable_collisions link1="panda_hand" link2="panda_link4" reason="Never"/> + <disable_collisions link1="panda_hand" link2="panda_link5" reason="Default"/> + <disable_collisions link1="panda_hand" link2="panda_link6" reason="Never"/> + <disable_collisions link1="panda_hand" link2="panda_link7" reason="Default"/> + <disable_collisions link1="panda_hand" link2="panda_link8" reason="Adjacent"/> + <disable_collisions link1="panda_hand" link2="panda_rightfinger" reason="Adjacent"/> + <disable_collisions link1="panda_leftfinger" link2="panda_link4" reason="Never"/> + <disable_collisions link1="panda_leftfinger" link2="panda_link5" reason="Default"/> + <disable_collisions link1="panda_leftfinger" link2="panda_link6" reason="Never"/> + <disable_collisions link1="panda_leftfinger" link2="panda_link7" reason="Never"/> + <disable_collisions link1="panda_leftfinger" link2="panda_link8" reason="Never"/> + <disable_collisions link1="panda_leftfinger" link2="panda_rightfinger" reason="Default"/> + <disable_collisions link1="panda_link4" link2="panda_rightfinger" reason="Never"/> + <disable_collisions link1="panda_link5" link2="panda_rightfinger" reason="Default"/> + <disable_collisions link1="panda_link6" link2="panda_rightfinger" reason="Never"/> + <disable_collisions link1="panda_link7" link2="panda_rightfinger" reason="Never"/> + <disable_collisions link1="panda_link8" link2="panda_rightfinger" reason="Never"/> + </xacro:macro> +</robot> diff --git a/config/panda.srdf.xacro b/config/panda.srdf.xacro new file mode 100644 index 0000000000000000000000000000000000000000..d379ec94bf3e69cad7eee671c70b58ea4f78ca5c --- /dev/null +++ b/config/panda.srdf.xacro @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--This does not replace URDF, and is not an extension of URDF. + This is a format for representing semantic information about the robot structure. + A URDF file must exist for this robot as well, where the joints and the links that are referenced are defined +--> +<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="panda"> + <xacro:include filename="$(find panda_moveit_config)/config/panda_arm.xacro" /> + <xacro:arm /> + + <xacro:arg name="hand" default="false" /> + + <!--Add the hand if people request it--> + <xacro:if value="$(arg hand)"> + <xacro:include filename="$(find panda_moveit_config)/config/hand.xacro" /> + <xacro:hand /> + + <!--END EFFECTOR: Purpose: Represent information about an end effector.--> + <end_effector name="hand" parent_link="panda_link8" group="hand" parent_group="panda_arm" /> + </xacro:if> + +</robot> diff --git a/config/panda_arm.xacro b/config/panda_arm.xacro new file mode 100644 index 0000000000000000000000000000000000000000..48674a8a4e6d3372e045be0f4edb32af890b4ce7 --- /dev/null +++ b/config/panda_arm.xacro @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="panda"> + <xacro:macro name="arm"> + <!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc--> + <!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included--> + <!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included--> + <!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group--> + <!--SUBGROUPS: Groups can also be formed by referencing to already defined group names--> + <group name="panda_arm"> + <chain base_link="panda_link0" tip_link="panda_link8"/> + </group> + <!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'--> + <group_state name="ready" group="panda_arm"> + <joint name="panda_joint1" value="0"/> + <joint name="panda_joint2" value="-0.785"/> + <joint name="panda_joint3" value="0"/> + <joint name="panda_joint4" value="-2.356"/> + <joint name="panda_joint5" value="0"/> + <joint name="panda_joint6" value="1.571"/> + <joint name="panda_joint7" value="0.785"/> + </group_state> + <group_state name="extended" group="panda_arm"> + <joint name="panda_joint1" value="0"/> + <joint name="panda_joint2" value="0"/> + <joint name="panda_joint3" value="0"/> + <joint name="panda_joint4" value="0"/> + <joint name="panda_joint5" value="0"/> + <joint name="panda_joint6" value="0"/> + <joint name="panda_joint7" value="0.785"/> + </group_state> + <!--VIRTUAL JOINT: Purpose: this element defines a virtual joint between a robot link and an external frame of reference (considered fixed with respect to the robot)--> + <virtual_joint name="virtual_joint" type="fixed" parent_frame="world" child_link="panda_link0"/> + <!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. --> + <disable_collisions link1="panda_link0" link2="panda_link1" reason="Adjacent"/> + <disable_collisions link1="panda_link0" link2="panda_link2" reason="Never"/> + <disable_collisions link1="panda_link0" link2="panda_link3" reason="Never"/> + <disable_collisions link1="panda_link0" link2="panda_link4" reason="Never"/> + <disable_collisions link1="panda_link1" link2="panda_link2" reason="Adjacent"/> + <disable_collisions link1="panda_link1" link2="panda_link3" reason="Default"/> + <disable_collisions link1="panda_link1" link2="panda_link4" reason="Never"/> + <disable_collisions link1="panda_link2" link2="panda_link3" reason="Adjacent"/> + <disable_collisions link1="panda_link2" link2="panda_link4" reason="Never"/> + <disable_collisions link1="panda_link3" link2="panda_link4" reason="Adjacent"/> + <disable_collisions link1="panda_link3" link2="panda_link6" reason="Never"/> + <disable_collisions link1="panda_link4" link2="panda_link5" reason="Adjacent"/> + <disable_collisions link1="panda_link4" link2="panda_link6" reason="Never"/> + <disable_collisions link1="panda_link4" link2="panda_link7" reason="Never"/> + <disable_collisions link1="panda_link4" link2="panda_link8" reason="Never"/> + <disable_collisions link1="panda_link5" link2="panda_link6" reason="Adjacent"/> + <disable_collisions link1="panda_link5" link2="panda_link7" reason="Default"/> + <disable_collisions link1="panda_link6" link2="panda_link7" reason="Adjacent"/> + <disable_collisions link1="panda_link7" link2="panda_link8" reason="Adjacent"/> + </xacro:macro> +</robot> diff --git a/launch/demo.launch b/launch/demo.launch index 05d4db4e2951016bd5be2c9b6d4716e3151d0cef..b545a3eba9e30c1b52c6bf48f0478cd53017708f 100644 --- a/launch/demo.launch +++ b/launch/demo.launch @@ -11,6 +11,9 @@ <!-- By default, we are not in debug mode --> <arg name="debug" default="false" /> + <!-- By default we will load the gripper --> + <arg name="load_gripper" default="true" /> + <!-- By default, we will load or override the robot_description --> <arg name="load_robot_description" default="true"/> @@ -52,6 +55,7 @@ <arg name="info" value="true"/> <arg name="debug" value="$(arg debug)"/> <arg name="pipeline" value="$(arg pipeline)"/> + <arg name="load_gripper" value="$(arg load_gripper)"/> <arg name="load_robot_description" value="$(arg load_robot_description)"/> </include> diff --git a/launch/move_group.launch b/launch/move_group.launch index 9cb72b8cd75438c0fbe3f1d6c9f89f6302ac18fd..1dc4a5b1b1f6b2711138071af25db09782746789 100644 --- a/launch/move_group.launch +++ b/launch/move_group.launch @@ -21,6 +21,10 @@ <arg name="capabilities" default=""/> <arg name="disable_capabilities" default=""/> + + <!--Other settings--> + <arg name="load_gripper" default="true" /> + <!-- load these non-default MoveGroup capabilities (space seperated) --> <!-- <arg name="capabilities" value=" @@ -41,6 +45,7 @@ <!-- load URDF, SRDF and joint_limits configuration --> <include file="$(dirname)/planning_context.launch"> <arg name="load_robot_description" value="$(arg load_robot_description)" /> + <arg name="load_gripper" value="$(arg load_gripper)" /> </include> <!-- Planning Pipelines --> diff --git a/launch/planning_context.launch b/launch/planning_context.launch index ef17b2bed032344f5d40d654dbbe4ae1069fabda..27d5a3ae72a50d8dc2969aa45f00e6a577857463 100644 --- a/launch/planning_context.launch +++ b/launch/planning_context.launch @@ -1,15 +1,16 @@ <launch> <!-- By default we do not overwrite the URDF. Change the following to true to change the default behavior --> + <arg name="load_gripper" default="true" /> <arg name="load_robot_description" default="false"/> <!-- The name of the parameter under which the URDF is loaded --> <arg name="robot_description" default="robot_description"/> <!-- Load universal robot description format (URDF) --> - <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="xacro hand:=true '$(find franka_description)/robots/panda_arm.urdf.xacro'"/> + <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="xacro hand:=$(arg load_gripper) '$(find franka_description)/robots/panda_arm.urdf.xacro'"/> <!-- The semantic description that corresponds to the URDF --> - <param name="$(arg robot_description)_semantic" textfile="$(find panda_moveit_config)/config/panda.srdf" /> + <param name="$(arg robot_description)_semantic" command="$(find xacro)/xacro '$(find panda_moveit_config)/config/panda.srdf.xacro' hand:=$(arg load_gripper)"/> <!-- Load updated joint limits (override information from URDF) --> <group ns="$(arg robot_description)_planning">