Skip to content

FlorianBauer/panda-controller

Repository files navigation

Panda Controller

A SiLA 2 compliant robot arm controller for an Panda from Franka Emika. For a short function overview and a description on how to use this software, take a look into the User Guide.

Requirements

Packages and ROS

  1. Install the following basic packages.
sudo apt install -y build-essential autoconf libtool pkg-config cmake
  1. Install ROS from the Install Site. It is recommended to install ROS Noetic and the ros-<distro>-desktop-full package. Also install the following packages afterwards.
sudo apt install ros-noetic-moveit ros-noetic-franka-control
  1. Install the following packages required for SiLA.
sudo apt install qtbase5-dev libssl-dev libavahi-client-dev libavahi-common-dev

Build and Install a Linux Real-Time Kernel

The Real-Time kernel is necessary for dealing with actual hardware. If only a simulation via MoveIt and RViz is sufficient, this step can be omitted.

Install Instructions:
Franka Emika Set-Up Guide
RT Kernel Set-Up Guide

Build and Install gRPC

  1. Set the environment variables.
export LOCAL_INSTALL_DIR=$HOME/.local
export PATH="$PATH:$LOCAL_INSTALL_DIR/bin"
  1. Create the install directory.
mkdir -p $LOCAL_INSTALL_DIR
  1. Clone the gRPC repository. (The -b option defines the branch)
git clone --recurse-submodules -b v1.34.x https://github.com/grpc/grpc
cd grpc
  1. Build and install gRPC. (The -j option defines the number of jobs/cores used)
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON \
      -DgRPC_BUILD_TESTS=OFF \
      -DgRPC_SSL_PROVIDER=package \
      -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL_DIR \
      -DBUILD_SHARED_LIBS=ON \
      ../..
make -j 4
make install
popd

Additional links:
sila_cpp Build Instructions
gRPC Quickstart

Build and Install sila_cpp

  1. Clone sila_cpp
git clone --recurse-submodules https://gitlab.com/SiLA2/sila_cpp.git
  1. Build sila_cpp. Ensure the LOCAL_INSTALL_DIR environment variable is still set. (Set with export LOCAL_INSTALL_DIR=$HOME/.local)
cd path/to/sila_cpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_PREFIX_PATH=$LOCAL_INSTALL_DIR \
      -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL_DIR \
      ..
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LOCAL_INSTALL_DIR/lib"
cmake --build .
  1. Install sila_cpp
cmake --install .
echo "$LOCAL_INSTALL_DIR/lib" | sudo tee /etc/ld.so.conf.d/sila_cpp.conf
sudo ldconfig

Additional links:
sila_cpp Build Instructions

Build the Project

  1. Create a Catkin workspace.
mkdir -p catkin_ws/src/
cd catkin_ws/src/
  1. If the recommended simulation mode should be available as well, the MoveIt-config shall also be built.
    Add the panda_moveit_config from https://github.com/ros-planning/panda_moveit_config
git clone https://github.com/ros-planning/panda_moveit_config.git -b melodic-devel
  1. Clone this project.
git clone --recurse-submodules https://github.com/FlorianBauer/panda-controller.git
  1. Build everything.
cd ..
source /opt/ros/noetic/setup.bash
catkin_make
  1. Copy the Feature Definition Language (FDL) files into the directory of the generated binary.
mkdir -p ./build/panda-controller/bin/meta
cp ./src/panda-controller/meta/*.sila.xml ./build/panda-controller/bin/meta/

Run the Project in MoveIt

  1. Start a terminal, source the workspace and launch MoveIt.
cd path/to/catkin_ws
source devel/setup.bash
roslaunch panda_moveit_config demo.launch
  1. After RViz has launched, open a new terminal and start the actual SiLA Server.
cd path/to/catkin_ws
source devel/setup.bash
./build/panda-controller/bin/PandaControlServer
  1. Now you can send commands and control the robot via SiLA. Therefore, generic SiLA clients can be found here:

Troubleshooting:

  • If a lib*.so: cannot open shared object file: No such file or directory error is shown on start-up of the SiLA server, check the environment was sourced correctly (e.g. with env) and is not executed as root-user. Also, if the sila_cpp installation with ldconfig failed or was omitted, it might be necessary to set the following environment variable before server start-up.
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib"
  • On opt/ros/noetic/lib/lib*.so: undefined reference to * after an catkin_build, check if all ROS packages are up-to-date with sudo apt update and sudo apt dist-upgrade.
  • If a WARNING: Could not open FDL file appears, check if the corresponding Feature Definition Language files are actually available in the ./build/panda-controller/bin/meta/-directory.
  • On an [registerPublisher] Failed to contact master at [localhost:11311]. Retrying... error, ensure the corresponding roslaunch script is running (panda_moveit_config in simulation or the launch file for the actual Franka Control Interface (FCI)).

Various Notes: To omit sourcing the workspace every time in a new terminal, the setup can be amended into .bashrc with echo 'source path/to/catkin_ws/devel/setup.bash' >> ~/.bashrc

To check the proper set up of the workspace echo $ROS_PACKAGE_PATH should return something like

/home/username/path/to/catkin_ws/src:/opt/ros/noetic/share

About

A SiLA 2 compliant controller for an Franka Emika Panda robot arm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published