1.franka硬件控制环境配置
a.libfranka安装
参考连接:https://github.com/frankaemika/libfranka
依赖项安装:
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
libpoco-dev \
libeigen3-dev \
dpkg
下载
# 下载包
git clone --recursive https://github.com/frankaemika/libfranka.git
cd libfranka
# 更改版本
git checkout 0.8.0
# Update submodules
git submodule update
# 编译
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF ..
cmake --build .
b.franka_ros安装
参考链接:https://frankaemika.github.io/docs/installation_linux.html
//创建工作空间
mkdir -p catkin_ws/src
cd catkin_ws
source /opt/ros/noetic/setup.sh
catkin_init_workspace src
//克隆包
git clone --recursive https://github.com/frankaemika/franka_ros src/franka_ros
//安装依赖项,编译包
rosdep install --from-paths src --ignore-src --rosdistro noetic -y --skip-keys libfranka
catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=/path/to/libfranka/build
source devel/setup.sh
/path/to/libfranka/build改为自己/libfranka/build的路径,libfranka后面不要忘记加build!
c.测试libfranka和franka_ros是否可以成功运行
libfranka测试:
cd ~/libfranka/libfranka/build/examples
./communication_test 172.16.0.2
如果机械臂开始动界面有消息表示成功
如果出现报错:unable to set realtime scheduling: Operation not permitted
两个可能的原因:
1)cpu没有调整到性能模式
安装indicator-cpufreq
sudo add-apt-repository ppa:artfwo/ppa
sudo apt-get update
sudo apt-get install indicator-cpufreq
安装后右上角会出现一个类似内存卡形状的小图标(如果没有重启电脑),点击它选择性能
测试代码改为:
cd ~/libfranka/libfranka/build/examples
sudo ./communication_test 172.16.0.2
如果成功,之后franka_ros也需要在root模式下
//进入root模式
su
cd catkin_ws
source devel/setup.bash //就算在环境变量中添加了也需要
2.moveit功能包配置
a.安装panda_moveit_config
cd ~/catkin_ws/src
git clone https://github.com/ros-planning/panda_moveit_config.git -b noetic-devel
cd ..
catkin_make
这个包只能用于仿真,要控制真实franka,需要自己生成一个
自己生成moveit_config:
参考链接:
https://blog.csdn.net/weixin_43651761/article/details/136543174
https://blog.csdn.net/qq_37464479/article/details/119299398
//打开 Moveit Setup Assistant
roslaunch moveit_setup_assistant setup_assistant.launch
选择 Create New MoveIt! Configuration Package
点击Browse,选择前面下载的franka_ros下的panda_arm.urdf.xacro,
其余操作按参考链接2进行;
安装完成后,把panda_moveit_config下的franka_control.launch拷到moveit_config下,再重新编译;
编译完成后运行
roslaunch moveit_config franka_control.launch robot_ip:=172.16.0.2 load_gripper:=false
完结,撒花!