Skip to content

ROS 1 and ROS 2 software packages for PhantomX Pincher Robot Arm

License

Notifications You must be signed in to change notification settings

snt-spacer/phantomx_pincher

Repository files navigation

PhantomX Pincher

Software packages that enable manipulation with simulated and real PhantomX Pincher Robot Arm.

Overview

This repository consists of the following packages. For more detailed information about each package, please see their corresponding README.md.

Instructions

Installation

Option A – Local Installation

Note: This option does not support using the real robot. Real robot requires ROS 1 controller and ros1_bridge to be run at the same time. Please, see Option B – Docker Installation for more information.

Dependencies

These are the primary dependencies required to use this project.

All additional dependencies are either pulled via vcstool (phantomx_pincher.repos) or installed via rosdep during the building process below.

Building

Clone this repository, import dependencies, install dependencies and build with colcon.

# Clone this repository into your favourite ROS 2 workspace
git clone https://github.com/snt-spacer/phantomx_pincher.git
# Import dependencies
vcs import < phantomx_pincher/phantomx_pincher.repos
# Install dependencies
IGNITION_VERSION=fortress rosdep install -y -r -i --rosdistro ${ROS_DISTRO} --from-paths .
# Build
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release"

Sourcing

Before utilising this package, remember to source the ROS 2 workspace.

source install/local_setup.bash

This enables:

  • Execution of binaries, scripts and examples via ros2 run phantomx_pincher* <executable>
  • Launching of setup scripts via ros2 launch phantomx_pincher* <launch_script>
  • Discoverability of shared resources
Option B – Using Docker

Docker

To install Docker on your system, you can run install_docker.bash to configure Docker with NVIDIA GPU support.

.docker/host/install_docker.bash

Build Image

To build a new Docker image from Dockerfile, you can run build.bash as shown below.

.docker/build.bash ${TAG:-ros2} ${BUILD_ARGS}

Run Container

To run the Docker container, you can use run.bash as shown below.

.docker/run.bash ${TAG:-ros2} ${CMD}

For convenience, additional three run scripts are available for directly using a fake (visual-only), simulated and real robot.

# Fake control inside RViz2
.docker/run_visual.bash
# Simulated control inside Gazebo
.docker/run_sim.bash
# Real control
.docker/run_real.bash

Run Dev Container

VS Code users familiar with Dev Containers can modify the included devcontainer.json to their needs. For convenience, open.bash script is available to open this repository as a Dev Container in VS Code.

.devcontainer/open.bash

Join Container

To join a running Docker container from another terminal, you can use join.bash as shown below.

.docker/join.bash ${CMD:-bash}

Getting Started

In order to get started, control a fake or simulated via the Motion Planning interface in RViz2.

# Fake control inside RViz2
ros2 launch phantomx_pincher fake.launch.py
# Simulated control inside Gazebo
ros2 launch phantomx_pincher gz.launch.py

The control of the real robot with ROS 2 is accomplished via ros1_bridge using the ROS 1 controller from ros1 branch of this repository. The ros1_bridge must be run separately and bridge at least /joint_states topic and [/joint_trajectory_controller/follow_joint_trajectory, /gripper_action_controller/gripper_cmd] actions. For convenience, Docker Compose setup that automatically runs everything needed to control the real robot is available. For simplicity, you can get started with the help of run_real.bash script as already shown above.

About

ROS 1 and ROS 2 software packages for PhantomX Pincher Robot Arm

Resources

License

Stars

Watchers

Forks