Skip to content

Commit

Permalink
Merge branch 'add_interface_arg_robot_description' into add_simulatio…
Browse files Browse the repository at this point in the history
…n_motion_generators
  • Loading branch information
rickstaa committed Feb 15, 2022
2 parents 854de52 + 1cc9431 commit 4d6fd66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
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

0 comments on commit 4d6fd66

Please sign in to comment.