当前位置: 首页 > 工具软件 > OpenRAVE > 使用案例 >

基于OpenRave的IkFast生成StaubliTx2-60L机械臂的封闭解

咸玄天
2023-12-01

参考:https://blog.csdn.net/Kalenee/article/details/80740258

先基于Ubuntu16.04环境安装kinetic版本的ros环境
接着安装sudo apt-get install ros-kinetic-moveit-kinematics

http://wiki.ros.org/urdf
https://www.guyuehome.com/372
https://blog.csdn.net/sinolover/article/details/90902182
基于SolidWorks的URDF导出插件,将StaubliTx2-60L的模型文件导出成urdf文件,然后使用OpenRave的IKFast工具生成对应的封闭解算法。
复习ROS中urdf建模的基本概念
https://blog.csdn.net/weixin_42237429/article/details/90480637

使用如下仓库里的脚本安装OpenRave
https://github.com/crigroup/openrave-installation

创建ros工作空间catkin_ws
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
echo $ROS_PACKAGE_PATH
cd src
git clone git@github.com:ros-industrial/staubli.git
git clone git@github.com:ros-industrial/staubli_experimental.git
cd ..
catkin_make
source ~/catkin_ws/devel/setup.bash

export MYROBOT_NAME="tx2_60l"
cd src/staubli_experimental/staubli_tx2_60_support/urdf
rosrun xacro xacro --inorder -o "$MYROBOT_NAME".urdf "$MYROBOT_NAME".xacro
rosrun collada_urdf urdf_to_collada "$MYROBOT_NAME".urdf "$MYROBOT_NAME".dae
export IKFAST_PRECISION="5"
cp "$MYROBOT_NAME".dae "$MYROBOT_NAME".backup.dae  # create a backup of your full precision dae.
rosrun moveit_kinematics round_collada_numbers.py "$MYROBOT_NAME".dae "$MYROBOT_NAME".dae "$IKFAST_PRECISION"
openrave-robot.py "$MYROBOT_NAME".dae --info links
openrave "$MYROBOT_NAME".dae


export PLANNING_GROUP="tx2_60l_arm"
export BASE_LINK="0"
export EEF_LINK="9"
export IKFAST_OUTPUT_PATH=`pwd`/ikfast61_"$PLANNING_GROUP".cpp

6轴机械臂
python `openrave-config --python-dir`/openravepy/_openravepy_/ikfast.py --robot="$MYROBOT_NAME".dae --iktype=transform6d --baselink="$BASE_LINK" --eelink="$EEF_LINK" --savefile="$IKFAST_OUTPUT_PATH"

g++ ikfast61_"$PLANNING_GROUP".cpp -lstdc++ -llapack -o compute -lrt


git clone git@github.com:davetcoleman/clam_rosbuild.git
取出ikfastdemo.cpp文件,将其与ikfast61_tx2_60l_arm.cpp和ikfast.h文件放在一起
将ikfastdemo.cpp文件中的#include "output_ikfast61.cpp"内容替换成#include “ikfast61_tx2_60l_arm.cpp”
g++ ikfastdemo.cpp -lstdc++ -llapack -o compute -lrt

计算正向运动学 
./compute fk 0 0 0 0 0 0

7轴机械臂
python `openrave-config --python-dir`/openravepy/_openravepy_/ikfast.py --robot="$MYROBOT_NAME".dae --iktype=transform6d --baselink="$BASE_LINK" --eelink="$EEF_LINK" --freeindex="$FREE_INDEX" --savefile="$IKFAST_OUTPUT_PATH"
 类似资料: