Franka Emika Panda - gkgkgk1215/else GitHub Wiki

  • The purpose of this documentation is to set up the Franka Emika Panda as quick as possible with the required bash commands.

  • For more details, please visit the following official documentations:

  • Official website: website

  • Official documents: documents

IP address setting

  • Both arms: 172.16.0.2(left), 172.16.0.3(right), 172.16.0.4(camera)
  • Workstation: 172.16.0.1
  • (common) NetMask: 255.255.255.0 (or 24)

Install libfranka

  • Remove the previous lib.
sudo apt remove "*libfranka*"
  • Install the dependencies.
sudo apt install build-essential cmake git libpoco-dev libeigen3-dev
  • Download the source code.
cd ~
git clone --recursive https://github.com/frankaemika/libfranka
cd libfranka
git checkout 0.9.1 (for panda, or 0.10.0 for fr3)
git submodule update
  • Remove the enforced "Real-time" option from "robot.h"
gedit ~/libfranka/include/franka/robot.h

Modify from "RealtimeConfig::kEnforce" to "RealtimeConfig::kIgnore"

  • Build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF ..
cmake --build . -j4
  • Test the set-up:
~/libfranka/build/examples/echo_robot_state 172.16.0.2
~/libfranka/build/examples/echo_robot_state 172.16.0.3
~/libfranka/build/examples/communication_test 172.16.0.2
~/libfranka/build/examples/communication_test 172.16.0.3
~/libfranka/build/examples/cartesian_impedance_control 172.16.0.2
~/libfranka/build/examples/cartesian_impedance_control 172.16.0.3

Install ROS driver

  • Create catkin workspace:
cd ~ && mkdir -p catkin_ws/src && cd catkin_ws
source /opt/ros/noetic/setup.sh
catkin_init_workspace src
  • Clone the repo from GitHub:
git clone --recursive https://github.com/frankaemika/franka_ros src/franka_ros
  • Version control
cd ~/catkin_ws/src/franka_ros
git checkout 0.8.0 (for panda, or 0.10.0 for fr3)
git submodule update
  • Remove the enforced "Real-time" option from "franka_control_node.yaml"
gedit ~/catkin_ws/src/franka_ros/franka_control/config/franka_control_node.yaml

"realtime_config: enforce" -> "realtime_config: ignore"

  • Build the Catkin src:
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src --rosdistro noetic -y --skip-keys libfranka
catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=~/libfranka/build
source devel/setup.sh

Test the ROS driver:

  • Visualization package
roslaunch franka_visualization franka_visualization.launch robot_ip:=172.16.0.2 load_gripper:=true
  • Cartesian impedance package
roslaunch franka_example_controllers cartesian_impedance_example_controller.launch robot_ip:=172.16.0.2 load_gripper:=true
  • Control package:
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.2 load_gripper:=true
gedit ~/catkin_ws/src/franka_ros/franka_control/config/franka_control_node.yaml
  • To implement dual-arm operation, we need to modify the real-time priority:
sudo gedit /etc/security/limits.conf

Add the followings at the end of the file:

*     soft    rtprio        99
*     hard    rtprio        99

Then, check the priority after reboot the computer:

ulimit -a

Otherwise, the following function gives an error: "franka::setCurrentThreadToHighestSchedulerPriority()"

  • Combined-control package (for multiple Pandas): Please make sure to modify the following files:
gedit ~/catkin_ws/src/franka_ros/franka_control/launch/franka_combined_control.launch
<arg name="robot_ips" default= "{panda_1/robot_ip: 172.16.0.2, panda_2/robot_ip: 172.16.0.3}"/>
gedit ~/catkin_ws/src/franka_ros/franka_control/config/franka_combined_control_node.yaml
realtime_config: ignore

Then,

roslaunch franka_control franka_combined_control.launch
  • dual_arm_cartesian_impedance_example_controller (for multiple Pandas): Please make sure to modify the following files:
gedit ~/catkin_ws/src/franka_ros/franka_example_controllers/launch/dual_arm_cartesian_impedance_example_controller.launch
<arg name="robot_ips" default= "{panda_1/robot_ip: 172.16.0.2, panda_2/robot_ip: 172.16.0.3}"/>

Then,

roslaunch franka_example_controllers dual_arm_cartesian_impedance_example_controller.launch rviz:=true rqt:=false

This example refers the following urdf:

gedit ~/catkin_ws/src/franka_ros/franka_description/robots/dual_panda/dual_panda_example.urdf.xacro

Install Moveit

  • Delete the existing ROS package and install from source
sudo apt-get remove ros-noetic-panda-moveit-config -y
cd ~/catkin_ws/src && git clone https://github.com/ros-planning/panda_moveit_config.git
cd ~/catkin_ws && catkin_make
sudo apt-get install ros-noetic-moveit-simple-controller-manager ros-noetic-joint-trajectory-controller ros-noetic-moveit-ros-visualization ros-noetic-moveit-visual-tools ros-noetic-moveit-commander

Test with this launch file: roslaunch panda_moveit_config panda_control_moveit_rviz.launch

Trouble shooting

Initial IP address setting

  • Directly connect to the LAN port of the Robot Arm (not the controller)

Running a libfranka executable fails with โ€œConnection timeoutโ€

Official Documentation

communication_constraints_violation

Discontinuities can occur if your code commands actual jumps to the robot, but also because of network packet losses. Please check the bullet points in the Official Documentation

*In my case, the low speed (100 Mbps) of the switching LAN hub caused the issue. I changed the device to the better one which is capable of 1000 Mbps.

FCI feature registration

None of the libfranka examples is working (with "connection-timeout"), we must check the "Frank Control Interface (FCI)" is properly installed. It can be checked in the "https://172.16.0.2/desk/" - setting - system.

Firmware Update

  • 4.2.2๋กœ ํŽŒ์›จ์–ด ์—…๋ฐ์ดํŠธ ์™„๋ฃŒ
  • ์ด์ „ ๋ฒ„์ ผ์ธ 4.2.0๋Š” libfrank์™€ frankaROS์˜ ์ตœ์‹  ๋ฒ„์ ผ๊ณผ ํ˜ธํ™˜์ด ๋˜์ง€ ์•Š์œผ๋ฉฐ, ํ˜ธํ™˜๋˜๋Š” ๋ฒ„์ ผ์œผ๋กœ ์„ค์น˜๋ฅผ ํ•˜์—ฌ๋„ ์ผ๋ถ€ example์ด ๋™์ž‘ํ•˜์ง€ ์•Š๋Š” ๋ฌธ์ œ
  • ์—…๋ฐ์ดํŠธ๋Š” ์˜คํ”„๋ผ์ธ์œผ๋กœ ๊ฐ€๋Šฅํ•จ. (์˜จ๋ผ์ธ์€ IP๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฌธ์ œ๋กœ ๋ณต์žกํ•ด์ง) franka world์—์„œ ๋ฐ›์€ ํŒŒ์ผ์„ ๋กœ๋ด‡์— ์—…๋กœ๋“œํ•˜๊ณ , ๋กœ๋ด‡์— ์ƒํƒœ ํŒŒ์ผ์„ ๋‹ค์‹œ franka world์— ์—…๋กœ๋“œํ•˜๋ฉด ์™„๋ฃŒ๋จ
  • ๋˜๋„๋ก์ด๋ฉด ์ธํ„ฐ๋„ท์„ ๋„๊ณ  ๋„คํŠธ์›Œํฌ๊ฐ€ ๋ฐฉํ•ด๋ฐ›์ง€ ์•Š๋Š” ์ƒํ™ฉ์—์„œ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Œ.

Network setting

  • Shop Floor Network(SFN)๋Š” FCI๋ฅผ ์˜๋ฏธํ•จ. (panda๋ฅผ controlํ•˜๋Š” device)
  • ์ด๊ฒƒ์„ hub๋ฅผ ํ†ตํ•ด PC๋กœ ์—ฐ๊ฒฐํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” 172.16.0.2~4๋กœ ์ง€์ •ํ•˜๋ฉด ๋˜๊ณ ,
  • ์ด๊ฒƒ์„ ์ง์ ‘ PC์˜ ์—ฌ๋Ÿฌ network port๋กœ ์—ฐ๊ฒฐํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” ์•ž์˜ ์„ธ ์„น์…˜์„ ์ค‘๋ณต๋˜์ง€ ์•Š๊ฒŒ๋งŒ ํ•˜๋ฉด ๋จ.
  • SFN์„ DHCP๋กœ ํ•˜๋Š” ๋“ฑ IP๋ฅผ ์žƒ์–ด๋ฒ„๋ ค desk์— ์ ‘์†ํ•˜์ง€ ๋ชปํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š”, robot base์— ์žˆ๋Š” ํฌํŠธ๋กœ ์—ฐ๊ฒฐํ•˜์—ฌ DHCP๋กœ ์„ค์ •ํ•˜๋ฉด 192.168.0.1๋กœ desk์— ์ ‘์†์ด ๊ฐ€๋Šฅํ•จ. desk์—์„œ IP๋ฅผ ์žฌ์„ค์ •ํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋ฉด ๋จ.
  • ์—…๋ฐ์ดํŠธ๋œ 4.2.2 ํŽŒ์›จ์–ด๋Š” FCI๋ฅผ ํ™œ์„ฑํ™”ํ•˜์—ฌ์•ผ๋งŒ programming์ด ๊ฐ€๋Šฅํ•ด์ง.