Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the 'transmission' arg to the 'panda_arm.urdf.xacro' file #157

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions franka_description/robots/panda_arm.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<xacro:arg name="hand" default="false" />
<!-- Is the robot being simulated in gazebo?" -->
<xacro:arg name="gazebo" default="false" />
<!-- The transmission type that is used to control arm joints in gazebo: position, velocity, or effort -->
<xacro:arg name="transmission" default="effort" />

<xacro:unless value="$(arg gazebo)">
<!-- Create a URDF for a real hardware -->
Expand Down Expand Up @@ -45,13 +47,20 @@
</joint>


<xacro:gazebo-joint joint="$(arg arm_id)_joint1" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint2" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint3" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint4" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint5" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint6" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint7" transmission="hardware_interface/EffortJointInterface" />
<xacro:property name="transmission" value="$(arg transmission)" />
<!-- sanity check -->
<xacro:if value="${transmission.lower() not in ['position', 'velocity', 'effort']}" >
${xacro.fatal("transmission:=" + transmission + " is not one of position, velocity, or effort")}
</xacro:if>
<!-- Unify transmission argument into title case and expand to full name -->
<xacro:property name="transmission" value="hardware_interface/${transmission.title()}JointInterface" lazy_eval="false" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint1" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint2" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint3" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint4" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint5" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint6" transmission="${transmission}" />
<xacro:gazebo-joint joint="$(arg arm_id)_joint7" transmission="${transmission}" />

<xacro:transmission-franka-state arm_id="$(arg arm_id)" />
<xacro:transmission-franka-model arm_id="$(arg arm_id)"
Expand Down
2 changes: 2 additions & 0 deletions franka_gazebo/launch/panda.launch
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<arg name="arm_id" default="panda" doc="Name of the panda robot to spawn" />
<arg name="use_gripper" default="true" doc="Should a franka hand be mounted on the flange?" />
<arg name="controller" default=" " doc="Which example controller should be started? (One of {cartesian_impedance,model,force}_example_controller)" />
<arg name="transmission" default="effort" doc="Transmission type used for arm joints. One of position, velocity, effort." />
<arg name="x" default="0" doc="How far forward to place the base of the robot in [m]?" />
<arg name="y" default="0" doc="How far leftwards to place the base of the robot in [m]?" />
<arg name="z" default="0" doc="How far upwards to place the base of the robot in [m]?" />
Expand Down Expand Up @@ -43,6 +44,7 @@
command="xacro $(find franka_description)/robots/panda_arm.urdf.xacro
gazebo:=true
hand:=$(arg use_gripper)
transmission:=$(arg transmission)
arm_id:=$(arg arm_id)
xyz:='$(arg x) $(arg y) $(arg z)'
rpy:='$(arg roll) $(arg pitch) $(arg yaw)'">
Expand Down