Skip to content
Snippets Groups Projects
Commit d6f58e75 authored by Rick Staa's avatar Rick Staa Committed by Robert Haschke
Browse files

Convert panda.srdf to panda.srdf.xacro with arg hand:=true|false

Allow modular composition of SRDF from arm and hand.
parent cc290bcc
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ moveit_setup_assistant_config: ...@@ -4,7 +4,7 @@ moveit_setup_assistant_config:
relative_path: robots/panda_arm.urdf.xacro relative_path: robots/panda_arm.urdf.xacro
xacro_args: hand:=true xacro_args: hand:=true
SRDF: SRDF:
relative_path: config/panda.srdf relative_path: config/panda.srdf.xacro
CONFIG: CONFIG:
author_name: MoveIt maintainer team author_name: MoveIt maintainer team
author_email: moveit_releasers@googlegroups.com author_email: moveit_releasers@googlegroups.com
......
<?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>
<?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>
<?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>
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<!-- By default, we are not in debug mode --> <!-- By default, we are not in debug mode -->
<arg name="debug" default="false" /> <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 --> <!-- By default, we will load or override the robot_description -->
<arg name="load_robot_description" default="true"/> <arg name="load_robot_description" default="true"/>
...@@ -52,6 +55,7 @@ ...@@ -52,6 +55,7 @@
<arg name="info" value="true"/> <arg name="info" value="true"/>
<arg name="debug" value="$(arg debug)"/> <arg name="debug" value="$(arg debug)"/>
<arg name="pipeline" value="$(arg pipeline)"/> <arg name="pipeline" value="$(arg pipeline)"/>
<arg name="load_gripper" value="$(arg load_gripper)"/>
<arg name="load_robot_description" value="$(arg load_robot_description)"/> <arg name="load_robot_description" value="$(arg load_robot_description)"/>
</include> </include>
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
<arg name="capabilities" default=""/> <arg name="capabilities" default=""/>
<arg name="disable_capabilities" default=""/> <arg name="disable_capabilities" default=""/>
<!--Other settings-->
<arg name="load_gripper" default="true" />
<!-- load these non-default MoveGroup capabilities (space seperated) --> <!-- load these non-default MoveGroup capabilities (space seperated) -->
<!-- <!--
<arg name="capabilities" value=" <arg name="capabilities" value="
...@@ -41,6 +45,7 @@ ...@@ -41,6 +45,7 @@
<!-- load URDF, SRDF and joint_limits configuration --> <!-- load URDF, SRDF and joint_limits configuration -->
<include file="$(dirname)/planning_context.launch"> <include file="$(dirname)/planning_context.launch">
<arg name="load_robot_description" value="$(arg load_robot_description)" /> <arg name="load_robot_description" value="$(arg load_robot_description)" />
<arg name="load_gripper" value="$(arg load_gripper)" />
</include> </include>
<!-- Planning Pipelines --> <!-- Planning Pipelines -->
......
<launch> <launch>
<!-- By default we do not overwrite the URDF. Change the following to true to change the default behavior --> <!-- 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"/> <arg name="load_robot_description" default="false"/>
<!-- The name of the parameter under which the URDF is loaded --> <!-- The name of the parameter under which the URDF is loaded -->
<arg name="robot_description" default="robot_description"/> <arg name="robot_description" default="robot_description"/>
<!-- Load universal robot description format (URDF) --> <!-- 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 --> <!-- 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) --> <!-- Load updated joint limits (override information from URDF) -->
<group ns="$(arg robot_description)_planning"> <group ns="$(arg robot_description)_planning">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment