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

Gazebo support for KUKA KR10 #125

Open
wants to merge 9 commits into
base: melodic-devel
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions kuka_kr10_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 2.8.3)
project(kuka_kr10_gazebo)

find_package(catkin REQUIRED)

catkin_package()

install(DIRECTORY config launch urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
11 changes: 11 additions & 0 deletions kuka_kr10_gazebo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kuka_kr10_gazebo
================

## Usage
The simulation starts up paused by default. This enables us to turn off the physics engine, this is important to get the desired behavior from the ros-control position controller.


To bring up the simulated robot in Gazebo, run:
```
roslaunch kuka_kr10_gazebo kr10_gazebo.launch
```
3 changes: 3 additions & 0 deletions kuka_kr10_gazebo/config/joint_state_controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
21 changes: 21 additions & 0 deletions kuka_kr10_gazebo/config/kr10_arm_controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
arm_controller:
type: position_controllers/JointTrajectoryController
joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 0.05
joint_1: {trajectory: 0.1, goal: 0.1}
joint_2: {trajectory: 0.1, goal: 0.1}
joint_3: {trajectory: 0.1, goal: 0.1}
joint_4: {trajectory: 0.1, goal: 0.1}
joint_5: {trajectory: 0.1, goal: 0.1}
joint_6: {trajectory: 0.1, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 25
action_monitor_rate: 10
10 changes: 10 additions & 0 deletions kuka_kr10_gazebo/launch/kr10_control.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<launch>
<!-- load the joint state controller -->
<rosparam file="$(find kuka_kr10_gazebo)/config/joint_state_controller.yaml" command="load" />
<node name="joint_state_controller_spawner" pkg="controller_manager" type="spawner" args="joint_state_controller" />

<!-- load the arm controller -->
<rosparam file="$(find kuka_kr10_gazebo)/config/kr10_arm_controller.yaml" command="load" />
<node name="kuka_kr10_controller_spawner" pkg="controller_manager" type="spawner" args="arm_controller" />
</launch>
34 changes: 34 additions & 0 deletions kuka_kr10_gazebo/launch/kr10_gazebo.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<launch>
<arg name="paused" default="false"/>
<arg name="gui" default="true"/>
<arg name="remap" default="true"/>

<group if="$(arg remap)">
<!-- remap topics to conform to ROS-I specifications -->
<remap from="/arm_controller/follow_joint_trajectory" to="/joint_trajectory_action"/>
<remap from="/arm_controller/state" to="/feedback_states"/>
<remap from="/arm_controller/command" to="/joint_path_command"/>

<!-- startup simulated world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="worlds/empty.world"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="paused" value="$(arg paused)"/>
</include>
</group>

<group unless="$(arg remap)">
<!-- startup simulated world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="worlds/empty.world"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="paused" value="$(arg paused)"/>
</include>
</group>

<!-- send robot URDF to ROS param server,
and spawn robot in Gazebo, along with necessary ROS nodes -->
<include file="$(find kuka_kr10_gazebo)/launch/spawn_kr10.launch"/>

</launch>
4 changes: 4 additions & 0 deletions kuka_kr10_gazebo/launch/load_kr10.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<launch>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find kuka_kr10_gazebo)/urdf/kr10.xacro'"/>
</launch>
25 changes: 25 additions & 0 deletions kuka_kr10_gazebo/launch/spawn_kr10.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<launch>
<!-- send robot urdf to ROS param server -->
<include file="$(find kuka_kr10_gazebo)/launch/load_kr10.launch"/>

<!-- push robot_description to factory and spawn robot in gazebo -->
<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model"
output="screen" respawn="false"
args="-urdf
-param robot_description
-model kuka_kr10r1100sixx
-x 0.0
-y 0.0
-z 0.0
-R 0.0
-P 0.0
-Y 0.0" />

<!-- convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

<!-- init and start Gazebo ros_control interface -->
<include file="$(find kuka_kr10_gazebo)/launch/kr10_control.launch"/>

</launch>
40 changes: 40 additions & 0 deletions kuka_kr10_gazebo/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<package>
<name>kuka_kr10_gazebo</name>
<version>0.0.1</version>
<description>
<p>
ROS-Industrial Gazebo support package for the Kuka kr10 (and variants).
</p>
<p>
This package contains the configuration data and launch files required
to simulate the Kuka kr10 manipulator in Gazebo. This includes the base
model, and the kr10.
</p>
<p>
Before using any of the configuration files included in this package, be
sure to check they are correct for the particular robot model and
configuration you intend to use them with.
</p>
</description>
<author email="[email protected]">Christopher Schindlbeck (Leibniz University Hannover)</author>
<maintainer email="[email protected]">G.A. vd. Hoorn (TU Delft Robotics Institute)</maintainer>
<license>Apache2.0</license>

<url type="website">http://wiki.ros.org/kuka_experimental</url>
<url type="bugtracker">https://github.com/ros-industrial/kuka_experimental/issues</url>
<url type="repository">https://github.com/ros-industrial/kuka_experimental</url>

<buildtool_depend>catkin</buildtool_depend>

<run_depend>kuka_resources</run_depend>
<run_depend>kuka_kr10_support</run_depend>
<run_depend>gazebo</run_depend>
<run_depend>gazebo_ros</run_depend>
<run_depend>gazebo_ros_control</run_depend>
<run_depend>gazebo_ros_pkgs</run_depend>
<run_depend>joint_state_controller</run_depend>
<run_depend>position_controllers</run_depend>
<run_depend>joint_trajectory_controller</run_depend>
<run_depend>robot_state_publisher</run_depend>
<run_depend>ros_controllers</run_depend>
</package>
15 changes: 15 additions & 0 deletions kuka_kr10_gazebo/urdf/kr10.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<robot name="kuka_kr10_gazebo" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- kr10 -->
<xacro:include filename="$(find kuka_kr10_gazebo)/urdf/kr10_macro.xacro"/>

<xacro:kuka_kr10_robot prefix=""/>

<!-- Fix robot to Gazebo world -->
<link name="world"/>
<joint name="world-base_link-fixed" type="fixed">
<parent link="world"/>
<child link="base_link"/>
<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
</joint>
</robot>
111 changes: 111 additions & 0 deletions kuka_kr10_gazebo/urdf/kr10_macro.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro">
<xacro:include filename="$(find kuka_kr10_support)/urdf/kr10r1100sixx_macro.xacro"/>
<xacro:macro name="kuka_kr10_robot" params="prefix">

<!-- get URDF description of Kuka kr10 model -->
<xacro:kuka_kr10r1100sixx prefix="${prefix}" />

<!-- transmission list -->
<transmission name="${prefix}tran1">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a1">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor1">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="${prefix}tran2">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a2">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor2">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="${prefix}tran3">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a3">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor3">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="${prefix}tran4">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a4">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor4">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="${prefix}tran5">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a5">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor5">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<transmission name="${prefix}tran6">
<robotNamespace>/${prefix}</robotNamespace>
<type>transmission_interface/SimpleTransmission</type>
<joint name="${prefix}joint_a6">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="${prefix}motor6">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
<!-- end of transmission list -->

<!-- Gazebo-specific link properties -->
<gazebo reference="${prefix}base_link">
<material>Gazebo/Black</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_1">
<material>Gazebo/Orange</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_2">
<material>Gazebo/Orange</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_3">
<material>Gazebo/Orange</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_4">
<material>Gazebo/Orange</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_5">
<material>Gazebo/Orange</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>
<gazebo reference="${prefix}link_6">
<material>Gazebo/Grey</material>
<turnGravityOff>true</turnGravityOff>
</gazebo>

<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/${prefix}</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>

</xacro:macro>
</robot>
1 change: 1 addition & 0 deletions kuka_kr10_support/urdf/kr10r1100sixx.xacro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0"?>

<robot name="kuka_kr10r1100sixx" xmlns:xacro="http://wiki.ros.org/xacro">
<xacro:include filename="$(find kuka_kr10_support)/urdf/kr10r1100sixx_macro.xacro" />
<xacro:kuka_kr10r1100sixx prefix=""/>
Expand Down
Loading