## ROS panda capacity package and catkin
This is an example catkin workspace for panda capacity calculation. In the this directory you can find the implementation of the python capacity module for a specific use case of Panda robot. The directory consists of two ros packages:
- franka_description: Panda robot definitions from Franka Emika http://wiki.ros.org/franka_description
- **panda_capacity: the capacity solver for Panda robot**
### Install the ros packages - using catkin
To run panda robot capacity calculation nodes first clone the repository and submodules:
```shell
git clone --recursive git@gitlab.inria.fr:auctus-team/people/antunskuric/ros/catkin_workspaces/panda_capacity_ws.git
cd panda_capacity_ws
```
And then just build the workspace
```shell
cd ..
catkin build
```
And you should be ready to go!
# panda_capacity package
`panda_capacity` package is an example implementation of the task space capacity calculation for for Franka Emika Panda robot in a form of a catkin ros package.
It uses the library [pinocchio](https://github.com/stack-of-tasks/pinocchio) for calculating robot kinematics.
## Dependencies
For visualizing the polytopes in RVIZ you will need to install the [jsk-rviz-plugin](https://github.com/jsk-ros-pkg/jsk_visualization)
```sh
sudo apt install ros-*-jsk-rviz-plugins # melodic/kinetic... your ros version
```
The code additionally depends on the pinocchio library.
### Pinocchio already installed
If you do already have pinocchio installed simply install the the pip package `pycapacity`
```
pip install pycapacity
```
And you're ready to go!
### Installing pinocchio
If you dont have pinocchio installed we suggest you to use Anaconda. Create the environment will all dependencies:
```bash
conda env create -f env.yaml
conda activate panda_capacity # activate the environment
```
Once the environment is activated you are ready to go.
## Create your own catkin workspace
Then create new catkin workspace:
```bash
mkdir ~/capacity_ws && cd ~/capacity_ws/
mkdir src && cd src
```
Clone the projects:
```shell
git clone https://gitlab.inria.fr/auctus-team/people/antunskuric/ros/ros_nodes/panda_capacity.git
```
Clone the Franka description package for visualisation
```shell
git clone https://gitlab.inria.fr/auctus-team/components/robots/panda/franka_description.git
```
Finally you can build the workspace
```shell
cd ..
catkin build
```
And you should be ready to go!
### One panda simulation
Once when you have everything installed you will be able to run the interactive simulations and see the polytope being visualised in real-time.
To see a simulation with one panda robot and its force and velocity manipulatibility ellipsoid and polytope run the command in the terminal.
```shell
source ~/capacity_ws/devel/setup.bash
roslaunch panda_capacity one_panda.launch
```
> If using anaconda, don't forget to call
> `conda activate panda_capacity`
> before you call `roslaunch`
### Two panda simulation
To demonstrate the collaborative robotics applications of our algorithm we have provided an interactive simulation of two panda robots where use can visualise their separate and joint force capacities.
For the interactive simulation of two panda robots with their own capacity measures you can simply run the commands:
```shell
source ~/your_catkin_ws/devel/setup.bash
roslaunch panda_capacity two_panda.launch
```
> If using anaconda, don't forget to call
> `conda activate panda_capacity`
> before you call `roslaunch`
#### Minkowski sum of polytopes
Open a new terminal and run the command:
```shell
source ~/your_catkin_ws/devel/setup.bash
rosrun panda_capacity panda_force_polytope_sum.py
```
> If using anaconda, don't forget to call
> `conda activate panda_capacity`
> before you call `rosrun`
#### Intersection of polytopes
Open a new terminal and run the command:
```shell
source ~/your_catkin_ws/devel/setup.bash
rosrun panda_capacity panda_force_polytope_intersection.py
```
> If using anaconda, don't forget to call
> `conda activate panda_capacity`
> before you call `rosrun`