Skip to content

Commit

Permalink
modified xacros to have a parametric origin for the model
Browse files Browse the repository at this point in the history
  • Loading branch information
SalvoVirga committed Apr 5, 2017
1 parent 3a50428 commit 6e7d2de
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 246 deletions.
4 changes: 3 additions & 1 deletion iiwa_description/launch/iiwa14_upload.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<!-- This lauch file just loads the URDF with the given hardware interface and robot name into the ROS Parameter Server -->
<arg name="hardware_interface" default="PositionJointInterface"/>
<arg name="robot_name" default="iiwa"/>
<arg name="origin_xyz" default="'0 0 0'"/> <!-- Note the syntax to pass a vector -->
<arg name="origin_rpy" default="'0 0 0'"/>

<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find iiwa_description)/urdf/iiwa14.urdf.xacro' hardware_interface:=$(arg hardware_interface) robot_name:=$(arg robot_name)" />
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find iiwa_description)/urdf/iiwa14.urdf.xacro' hardware_interface:=$(arg hardware_interface) robot_name:=$(arg robot_name) origin_xyz:=$(arg origin_xyz) origin_rpy:=$(arg origin_rpy)"/>
</launch>
6 changes: 4 additions & 2 deletions iiwa_description/launch/iiwa7_upload.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<!-- This lauch file just loads the URDF with the given hardware interface and robot name into the ROS Parameter Server -->
<arg name="hardware_interface" default="PositionJointInterface"/>
<arg name="robot_name" default="iiwa"/>

<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find iiwa_description)/urdf/iiwa7.urdf.xacro' hardware_interface:=$(arg hardware_interface) robot_name:=$(arg robot_name)" />
<arg name="origin_xyz" default="'0 0 0'"/> <!-- Note the syntax to pass a vector -->
<arg name="origin_rpy" default="'0 0 0'"/>

<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find iiwa_description)/urdf/iiwa7.urdf.xacro' hardware_interface:=$(arg hardware_interface) robot_name:=$(arg robot_name) origin_xyz:=$(arg origin_xyz) origin_rpy:=$(arg origin_rpy)" />
</launch>
49 changes: 21 additions & 28 deletions iiwa_description/urdf/iiwa.transmission.xacro
Original file line number Diff line number Diff line change
@@ -1,95 +1,88 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<xacro:macro name="iiwa_transmission" params="hardware_interface">

<transmission name="iiwa_tran_1">
<transmission name="${robot_name}_tran_1">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_1">
<joint name="${robot_name}_joint_1">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_1">
<actuator name="${robot_name}_motor_1">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_2">
<transmission name="${robot_name}_tran_2">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_2">
<joint name="${robot_name}_joint_2">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_2">
<actuator name="${robot_name}_motor_2">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_3">
<transmission name="${robot_name}_tran_3">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_3">
<joint name="${robot_name}_joint_3">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_3">
<actuator name="${robot_name}_motor_3">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_4">
<transmission name="${robot_name}_tran_4">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_4">
<joint name="${robot_name}_joint_4">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_4">
<actuator name="${robot_name}_motor_4">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_5">
<transmission name="${robot_name}_tran_5">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_5">
<joint name="${robot_name}_joint_5">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_5">
<actuator name="${robot_name}_motor_5">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_6">
<transmission name="${robot_name}_tran_6">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_6">
<joint name="${robot_name}_joint_6">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_6">
<actuator name="${robot_name}_motor_6">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

<transmission name="iiwa_tran_7">
<transmission name="${robot_name}_tran_7">
<robotNamespace>/${robot_name}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="iiwa_joint_7">
<joint name="${robot_name}_joint_7">
<hardwareInterface>${hardware_interface}</hardwareInterface>
</joint>
<actuator name="iiwa_motor_7">
<actuator name="${robot_name}_motor_7">
<hardwareInterface>${hardware_interface}</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>

</xacro:macro>

</robot>



10 changes: 6 additions & 4 deletions iiwa_description/urdf/iiwa14.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

<xacro:arg name="hardware_interface" default="PositionJointInterface"/>
<xacro:arg name="robot_name" default="iiwa"/>

<xacro:arg name="origin_xyz" default="0 0 0"/>
<xacro:arg name="origin_rpy" default="0 0 0"/>

<!-- Fix to world just for testing -->
<link name="world"/>

<!--iiwa-->
<xacro:iiwa14 hardware_interface="$(arg hardware_interface)" robot_name="$(arg robot_name)" parent="world">
<origin xyz="0 0 0.0" rpy="0 0 0" />
<origin xyz="$(arg origin_xyz)" rpy="$(arg origin_rpy)" />
</xacro:iiwa14>

</robot>
Loading

0 comments on commit 6e7d2de

Please sign in to comment.