Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/hsp-iit/gazebo-yarp-digit-plugin

A tentative C++ wrapper for the Python based Digit tactile sensor simulation
https://github.com/hsp-iit/gazebo-yarp-digit-plugin

Last synced: 8 days ago
JSON representation

A tentative C++ wrapper for the Python based Digit tactile sensor simulation

Lists

README

        

# gazebo-yarp-digit-plugin (WIP)

A tentative C++-based Gazebo-YARP plugin for the python-based DIGIT tactile sensor simulator.

This is a work in progress and very likely to change often:
- No connections to a physical environment are considered
- The interaction between the sensor and a single object is considered

## Dependencies

- [pybind11](https://github.com/pybind/pybind11)
> can be installed, e.g. on Ubuntu, using `apt install pybind11-dev`
- [TACTO](https://github.com/facebookresearch/tacto.git)
> it is **not** required to download it as the provided `CMakeLists.txt` take care of it
- [Gazebo-YARP plugins](https://github.com/robotology/gazebo-yarp-plugins)
> To install it, refer to this [quick start guide](http://robotology.github.io/gazebo-yarp-plugins/master/)

## How to build

**We strongly advise to create a Python virtual environment before proceeding**.

```console
git clone https://github.com/robotology-playground/gazebo-yarp-digit-plugin.git
cd gazebo-yarp-digit-plugin
mkdir build
cd build
cmake ../
```
> At this point, please wait for the `TACTO` repository to be cloned.

```console
pip install -r _deps/tacto-src/requirements/requirements.txt
make -j
```

> Then, put the following lines of code in the ~/.bashrc:
```console
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/path/to/the/repo/gazebo-yarp-digit-plugin/build/lib
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/path/to/the/repo/gazebo-yarp-digit-plugin/models

```
(Remember to source the .bashrc)
## How to attach a DIGIT to your model
The following snippet code is an example on how to add the DIGIT link to your robot
```xml

"your_pose"

0 0 0.015 0 0 0
.1

1
0
0
1
0
1



0 0 0 0 0 0

"path to the digit.STL file into the models/digit directory"




"path to the digit.STL file into the models directory "




"your_collision_name"

30

```
The following snippet shows how to declare the RendererDigitPlugin
```xml

your_object
the relative path of your object mesh
N(number of sensors used)
base
contact_digit
...
base
contact_digit
s

```
The `ObjectName` parameter is the name of the object the sensors are sensitive to.
The `ObjectMeshAbsolutePath` parameter is the path of the mesh of the object.
The `NumberOfSensors` parameter indicates the number of sensors in the model.
The `LinkName` and `SensorName` parameters indicate the name of the links and sensors attached to them.
The `UpdatePeriod` parameters indicates the sleep time of the rendering thread in seconds.

The following snippet shows how to declare the ControlDigitPlugin
```xml

10

```
The following snippet shows how to declare the ControlPlugin
```xml

10
link_name
/name/of/the/output/port
/name/of/the/rpc/port

```
The `Link` parameter indicates the name of the link that is controlled.
The `PortOutputPoseName` and `PortRpcName` indicates the names of the port which outputs the real time pose of the link and the name of the rpc port to send command to.

At the moment, the urdf snippet code is not available.

## How to run the examples

### DIGIT and ball
The code simulates the contact between the sensor and a small ball which touches the sensor periodically.

1. Run the `yarpserver`

2. Run the executable
```console
gazebo ../world/digit_and_ball.world
```

3. Open a terminals and write `yarpview --name /in:i`

4. In another terminal, connect ports
```console
yarp connect /gazebo-yarp-digit-plugin/output:o /in:i
```

### Left hand mk3 with one sensor

1. Run the `yarpserver`

2. Run the executable
```console
gazebo world/hand_one_sensor.world
```

3. Open a terminals and write `yarpview --name /medium:i`

4. In another terminal, connect ports
```console
yarp connect /gazebo-yarp-digit-plugin-sensor_link_medium"/output:o /medium:i
```
5. Launch the binary `./build/bin/grasp-example`

6. In another terminal, launch the script `GraspExample/script.sh`

### Left hand mk3 with 3 sensors
1. Run the `yarpserver`

2. Run the executable
```console
gazebo world/hand_three_sensors.world
```
3. Open 3 terminals and write `yarpview --name /thumb:i` `yarpview --name /index:i` `yarpview --name /medium:i`
4. In another terminal, connect ports
```console
yarp connect /gazebo-yarp-digit-plugin-sensor_link_thumb/output:o /in1:i
yarp connect /gazebo-yarp-digit-plugin-sensor_link_index/output:o /in2:i
yarp connect /gazebo-yarp-digit-plugin-sensor_link_medium/output:o /in3:i
```