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
- Matching versions of robot system version, libfranka version, and robot/gripper server version
- Refer: https://frankaemika.github.io/docs/compatibility.html https://frankaemika.github.io/docs/libfranka_changelog.html#id6
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โ
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์ด ๊ฐ๋ฅํด์ง.