Skip to content

Commit

Permalink
Add multirobot example
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffrey Biggs <[email protected]>
  • Loading branch information
gbiggs committed May 22, 2022
1 parent 75d1eb8 commit 68d14e1
Show file tree
Hide file tree
Showing 62 changed files with 750,228 additions and 0 deletions.
1 change: 1 addition & 0 deletions drake_ros_examples/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
add_subdirectory(iiwa_manipulator)
add_subdirectory(multirobot)
add_subdirectory(rs_flip_flop)
14 changes: 14 additions & 0 deletions drake_ros_examples/examples/multirobot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
install(
PROGRAMS multirobot.py
DESTINATION lib/${PROJECT_NAME}
)

install(
DIRECTORY iiwa_description
DESTINATION share/${PROJECT_NAME}
)

install(
FILES multirobot.rviz
DESTINATION share/${PROJECT_NAME}
)
19 changes: 19 additions & 0 deletions drake_ros_examples/examples/multirobot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Multirobot

## Overview

The `multirobot.py` script enables RViz visualisation of an array of Kuka LBR iiwa manipulators.
It publishes the following topics:

* `/tf` (all scene frames)
* `/` ()

## How to run the example

Run the Python `multirobot.py` script as explained [here](../../README.md#running).

In a separate terminal, launch RViz and provide the path to the configuration file to visualise the robots.

```
ros2 run rviz2 rviz2 -d $(ros2 pkg prefix drake_ros_examples)/share/drake_ros_examples/multirobot.rviz
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- python -*-

load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")

# This package is public so that other packages can refer to
# individual files in model from their bazel rules.
package(
default_visibility = ["//visibility:public"],
)

# === test/ ===

drake_cc_googletest(
name = "dual_iiwa14_polytope_collision_test",
srcs = ["urdf/test/dual_iiwa14_polytope_collision_test.cc"],
data = [":models"],
deps = [
"//common:find_resource",
"//multibody/parsing",
"//multibody/plant",
],
)

install_data(
extra_prod_models = [
"LICENSE.TXT",
"iiwa_stack.LICENSE.txt",
],
)

add_lint_tests()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This folder contains a model of the Kuka LBR IIWA robot. The files were
originally taken from https://github.com/SalvoVirga/iiwa_stack, SHA
2fa5bd5. The original license for these files is given in the link below and
copied into file iiwa_stack.LICENSE.txt.

https://github.com/SalvoVirga/iiwa_stack/blob/2fa5bd5/LICENSE.txt

Since obtaining the model files from the above-mentioned source, they were
substantially modified for use by Drake. For example, the original STL mesh
files were converted to OBJ files, and various mass / inertia properties and
collision models were modified. Our changes are covered by Drake's license terms
(see LICENSE.TXT in Drake's root folder).
15 changes: 15 additions & 0 deletions drake_ros_examples/examples/multirobot/iiwa_description/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Execute the following commands to regenerate the URDF files using xacro. Note
that ROS Jade or newer must be used because the xacro scripts make use of more
expressive conditional statements [1].

```
source /opt/ros/kinetic/setup.bash
cd drake/manipulation/models
export ROS_PACKAGE_PATH=`pwd`:$ROS_PACKAGE_PATH
cd iiwa_description
rosrun xacro xacro -o urdf/iiwa14_primitive_collision.urdf urdf/iiwa14_primitive_collision.urdf.xacro
rosrun xacro xacro -o urdf/iiwa14_polytope_collision.urdf urdf/iiwa14_polytope_collision.urdf.xacro
rosrun xacro xacro -o urdf/dual_iiwa14_polytope_collision.urdf urdf/dual_iiwa14_polytope_collision.urdf.xacro
```

[1] http://wiki.ros.org/xacro#Conditional_Blocks
Loading

0 comments on commit 68d14e1

Please sign in to comment.