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이 가능해짐.