Franka Emika Multiple Pandas with Different System Versions - 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.
- 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 for Panda & Fr3
cd ~
git clone --recursive https://github.com/frankaemika/libfranka
mv libfranka libfranka_panda && cd libfranka_panda
git checkout 0.9.1 && git submodule update
cd ~
git clone --recursive https://github.com/frankaemika/libfranka
mv libfranka libfranka_fr3 && cd libfranka_fr3
git checkout 0.10.0 && git submodule update
- Remove the enforced "Real-time" option from "robot.h" Modify from "RealtimeConfig::kEnforce" to "RealtimeConfig::kIgnore"
gedit ~/libfranka_panda/include/franka/robot.h
gedit ~/libfranka_fr3/include/franka/robot.h
- Build
cd ~/libfranka_panda && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF ..
cmake --build . -j4
cd ~/libfranka_fr3 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF ..
cmake --build . -j4
- Test the set-up:
~/libfranka_panda/build/examples/echo_robot_state 172.16.0.2
~/libfranka_panda/build/examples/echo_robot_state 172.16.0.3
~/libfranka_panda/build/examples/communication_test 172.16.0.2
~/libfranka_panda/build/examples/communication_test 172.16.0.3
~/libfranka_panda/build/examples/cartesian_impedance_control 172.16.0.2
~/libfranka_panda/build/examples/cartesian_impedance_control 172.16.0.3
~/libfranka_fr3/build/examples/echo_robot_state 172.16.0.4
~/libfranka_fr3/build/examples/communication_test 172.16.0.4
~/libfranka_fr3/build/examples/cartesian_impedance_control 172.16.0.4
- Create catkin workspace:
cd ~ && mkdir -p catkin_ws_panda/src && cd catkin_ws_panda
source /opt/ros/noetic/setup.sh
catkin_init_workspace src
git clone --recursive https://github.com/frankaemika/franka_ros src/franka_ros
cd ~/catkin_ws_panda/src/franka_ros
git checkout 0.8.0
git submodule update
- Build the Catkin src:
cd ~/catkin_ws_panda
rosdep install --from-paths src --ignore-src --rosdistro noetic -y --skip-keys libfranka
catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=~/libfranka_panda/build
source devel/setup.sh
- Remove the enforced "Real-time" option from "franka_control_node.yaml" "realtime_config: enforce" -> "realtime_config: ignore"
gedit ~/catkin_ws_panda/src/franka_ros/franka_control/config/franka_control_node.yaml
- Create catkin workspace:
cd ~ && mkdir -p catkin_ws_fr3/src && cd catkin_ws_fr3
source /opt/ros/noetic/setup.sh
catkin_init_workspace src
git clone --recursive https://github.com/frankaemika/franka_ros src/franka_ros
cd ~/catkin_ws_fr3/src/franka_ros
git checkout 0.10.0
git submodule update
- Build the Catkin src:
cd ~/catkin_ws_fr3
rosdep install --from-paths src --ignore-src --rosdistro noetic -y --skip-keys libfranka
catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=~/libfranka_fr3/build
source devel/setup.sh
- Remove the enforced "Real-time" option from "franka_control_node.yaml" "realtime_config: enforce" -> "realtime_config: ignore"
gedit ~/catkin_ws_fr3/src/franka_ros/franka_control/config/franka_control_node.yaml
- Cartesian impedance package
source ~/catkin_ws_panda/devel/setup.bash
roslaunch franka_example_controllers cartesian_impedance_example_controller.launch robot_ip:=172.16.0.2 load_gripper:=false robot:=panda
source ~/catkin_ws_fr3/devel/setup.bash
roslaunch franka_example_controllers cartesian_impedance_example_controller.launch robot_ip:=172.16.0.4 load_gripper:=false robot:=fr3
- Control package
source ~/catkin_ws_panda/devel/setup.bash
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.2 load_gripper:=false robot:=panda
source ~/catkin_ws_fr3/devel/setup.bash
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.4 load_gripper:=false robot:=fr3
- For joint position control, spawn "position_joint_trajectory_controller" in "franka_control.launch"
<node name="state_controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="franka_state_controller position_joint_trajectory_controller"/>
- Add namespace to the following file to avoid topics with the same name
gedit ~/catkin_ws_panda/src/franka_ros/franka_control/launch/franka_control.launch
<arg name="ns_name" default="panda" />
<group ns="$(arg ns_name)">
..
..
</group>
- Comment this part for Panda. Otherwise, "/joint_states" topic will be duplicated.
<!--node name="joint_state_desired_publisher" type="joint_state_publisher" pkg="joint_state_publisher" output="screen">
<rosparam if="$(arg load_gripper)" param="source_list">[franka_state_controller/joint_states_desired, franka_gripper/joint_states] </rosparam>
<rosparam unless="$(arg load_gripper)" param="source_list">[franka_state_controller/joint_states_desired] </rosparam>
<param name="rate" value="30"/>
<remap from="/joint_states" to="/joint_states_desired" />
</node-->
- In terminal 1:
source ~/catkin_ws_panda/devel/setup.bash
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.2 load_gripper:=false ns_name:="panda1"
In terminal 2:
source ~/catkin_ws_panda/devel/setup.bash
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.3 load_gripper:=false ns_name:="panda2"
In terminal 3:
source ~/catkin_ws_fr3/devel/setup.bash
roslaunch franka_control franka_control.launch robot_ip:=172.16.0.4 load_gripper:=false ns_name:="fr3"
To launch combined control,
roslaunch franka_control franka_combined_control.launch robot_ips:="{panda_1/robot_ip: 172.16.0.2, panda_2/robot_ip: 172.16.0.3}"
ROS_PACKAGE_PATH=$(REMOVE_PART="/home/surglab/catkin_ws_fr3/src" sh -c 'echo ":$ROS_PACKAGE_PATH:" | sed "s@:$REMOVE_PART:@:@g;s@^:\(.*\):\$@\1@"')
export ROS_PACKAGE_PATH=/home/surglab/catkin_ws_panda/src:$ROS_PACKAGE_PATH
PYTHONPATH=$(REMOVE_PART="/home/surglab/catkin_ws_fr3/devel/lib/python3/dist-packages" sh -c 'echo ":$PYTHONPATH:" | sed "s@:$REMOVE_PART:@:@g;s@^:\(.*\):\$@\1@"')
export PYTHONPATH=/home/surglab/catkin_ws_panda/devel/lib/python3/dist-packages:$PYTHONPATH
echo $ROS_PACKAGE_PATH
echo $PYTHONPATH
source ~/catkin_ws_panda/devel/setup.bash
ROS_PACKAGE_PATH=$(REMOVE_PART="/home/surglab/catkin_ws_panda/src" sh -c 'echo ":$ROS_PACKAGE_PATH:" | sed "s@:$REMOVE_PART:@:@g;s@^:\(.*\):\$@\1@"')
export ROS_PACKAGE_PATH=/home/surglab/catkin_ws_fr3/src:$ROS_PACKAGE_PATH
PYTHONPATH=$(REMOVE_PART="/home/surglab/catkin_ws_panda/devel/lib/python3/dist-packages" sh -c 'echo ":$PYTHONPATH:" | sed "s@:$REMOVE_PART:@:@g;s@^:\(.*\):\$@\1@"')
export PYTHONPATH=/home/surglab/catkin_ws_fr3/devel/lib/python3/dist-packages:$PYTHONPATH
echo $ROS_PACKAGE_PATH
echo $PYTHONPATH