moveit和gazebo的联合抓取仿真

部分代码来源: UR5+robotiq_85_gripper GAZEBO模拟视觉抓取平台仿真
我的代码仓库

GAZEBO

new ur5_gazebo.launch

<?xml version="1.0"?>
<launch><arg name="limited" default="false"  doc="If true, limits joint range [-PI, PI] on all joints." /><arg name="paused" default="true" doc="Starts gazebo in paused mode" /><arg name="gui" default="true" doc="Starts gazebo gui" /><!-- startup simulated world --><!-- !!!! only paused==true  "spawn_model -J  shoulder_lift_joint -2.0" valid !!!! --><!-- should begin gazebo simulation firstly and roslaunch moveit_rviz, or rviz will be blocked --><include file="$(find gazebo_ros)/launch/empty_world.launch"><arg name="world_name" default="$(find ur5_single_arm_tufts)/worlds/ur5_cubes.world"/><arg name="paused" value="$(arg paused)"/><arg name="gui" value="$(arg gui)"/></include><!-- send robot urdf to param server --><param name="robot_description" command="$(find xacro)/xacro --inorder '$(find ur5_single_arm_tufts)/urdf/ur5_single_arm.urdf.xacro'"/><!-- spawn gazebo model --><node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model"args="-urdf -param robot_description -model robot -z 0.594-J shoulder_lift_joint -2.0-J elbow_joint 1.0"output="screen" /><include file="$(find ur5_single_arm_moveit_config)/launch/controller_utils.launch"/><!-- start this controller --><!-- Corresponding to the controllers.yaml --><rosparam file="$(find ur5_single_arm_moveit_config)/config/controllers.yaml" command="load"/><node name="arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn arm_controller gripper" respawn="false" output="screen"/><!-- load other controllers --><node name="ros_control_controller_manager" pkg="controller_manager" type="controller_manager" respawn="false" output="screen" args="load joint_group_position_controller" /></launch>

controller_utils.launch FIXED

Include joint_state_controller to publish /joint_states in gazebo and robot_state_publisher to subscribe /joint_states and publish /tf topic.

<?xml version="1.0"?>
<launch><!-- Robot state publisher --><!-- subscribe /joint_states and then publish /tf --><node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"><param name="publish_frequency" type="double" value="50.0" /><param name="tf_prefix" type="string" value="" /></node><!-- Fake Calibration --><node pkg="rostopic" type="rostopic" name="fake_joint_calibration"args="pub /calibrated std_msgs/Bool true" /><!-- joint_state_controller --><rosparam file="$(find robotiq_85_gazebo)/controller/joint_state_controller.yaml" command="load"/><node name="joint_state_controller_spawner" pkg="controller_manager" type="spawner" args="joint_state_controller" /></launch>

joint_state_controller.yamlFIXED

joint_state_controller:type: joint_state_controller/JointStateControllerpublish_rate: 50

controllers.yamlADDED TO REALIZE GAZEBO CONTROLLER CONFIGURATION

Copy from universal robot package and robotiq package

arm_controller:type: position_controllers/JointTrajectoryControllerjoints:- shoulder_pan_joint- shoulder_lift_joint- elbow_joint- wrist_1_joint- wrist_2_joint- wrist_3_jointconstraints:goal_time: 0.6stopped_velocity_tolerance: 0.05shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}elbow_joint: {trajectory: 0.1, goal: 0.1}wrist_1_joint: {trajectory: 0.1, goal: 0.1}wrist_2_joint: {trajectory: 0.1, goal: 0.1}wrist_3_joint: {trajectory: 0.1, goal: 0.1}stop_trajectory_duration: 0.5state_publish_rate:  25action_monitor_rate: 10
joint_group_position_controller:type: position_controllers/JointGroupPositionControllerjoints:- shoulder_pan_joint- shoulder_lift_joint- elbow_joint- wrist_1_joint- wrist_2_joint- wrist_3_joint
gripper:type: position_controllers/JointTrajectoryControllerjoints:- gripper_finger1_jointconstraints:goal_time: 0.6stopped_velocity_tolerance: 0.05gripper_finger1_joint: {trajectory: 0.1, goal: 0.1}stop_trajectory_duration: 0.5state_publish_rate:  25action_monitor_rate: 10
roslaunch ur5_single_arm_moveit_config ur5_gazebo.launch # launch gazebo simulation

MOVEIT

ur5_moveit_planning_execution.launchADDED TO LAUNCH MOVEIT

<launch><arg name="sim" default="true" /><arg name="debug" default="false" /><!-- !!!! Remap follow_joint_trajectory !!!! --><remap if="$(arg sim)" from="/follow_joint_trajectory" to="/arm_controller/follow_joint_trajectory"/><!-- Launch moveit --><include file="$(find ur5_single_arm_moveit_config)/launch/move_group.launch"><arg name="debug" default="$(arg debug)" /></include><include file="$(find ur5_single_arm_moveit_config)/launch/moveit_rviz.launch"><arg name="debug" value="false" /><arg name="config" value="true" /></include>
</launch>

ur5_moveit_controller_manager.launch.xmlMODIFIED TO SET CONTROLLER_LIST FOR MOVEIT

<launch><!--Set the param that trajectory_execution_manager needs to find the controller plugin--><arg name="moveit_controller_manager" default="moveit_simple_controller_manager/MoveItSimpleControllerManager" /><param name="moveit_controller_manager" value="$(arg moveit_controller_manager)"/><!--load controller_list--><rosparam file="$(find ur5_single_arm_moveit_config)/config/ros_controllers.yaml"/></launch>

ros_controllers.yaml

# Simulation settings for using moveit_sim_controllers
moveit_sim_hw_interface:joint_model_group: armjoint_model_group_pose: home
# Settings for ros_control_boilerplate control loop
generic_hw_control_loop:loop_hz: 300cycle_time_error_threshold: 0.01
# Settings for ros_control hardware interface
hardware_interface:joints:- shoulder_pan_joint- shoulder_lift_joint- elbow_joint- wrist_1_joint- wrist_2_joint- wrist_3_joint- gripper_finger1_jointsim_control_mode: 1  # 0: position, 1: velocity
# Publish all joint states
# Creates the /joint_states topic necessary in ROS
joint_state_controller:type: joint_state_controller/JointStateControllerpublish_rate: 50
controller_list:- name: arm_controlleraction_ns: follow_joint_trajectorydefault: Truetype: FollowJointTrajectoryjoints:- shoulder_pan_joint- shoulder_lift_joint- elbow_joint- wrist_1_joint- wrist_2_joint- wrist_3_joint- name: gripperaction_ns: follow_joint_trajectorydefault: Truetype: FollowJointTrajectoryjoints:gripper_finger1_joint

If the YAML file is missing, “No controller_list specified” will occur and MOVEIT cannot execute planned path.

# launch moveit
# note: should start the gazebo simulation!!!
roslaunch ur5_single_arm_moveit_config ur5_moveit_planning_execution.launch


NOTE

  • Gazebo implements the robot simulation function
    Publish the state of robot and Subscribe the instruction from planner move_group
  • Controller name must be consistent in ros_controllers.yaml and controllers.yaml, or ERROR INFO: “Unable to identify any set of controllers that can actuate the specified joints
  • ERROR INFO: “**Could not load controller ‘arm_controller’ because controller type ‘position_controllers/JointTrajectoryController’ does not exist.
    **”
    Solution
    sudo apt-get install ros-melodic-joint-trajectory-controller
  • ERROR INFO: “[gazebo-1] process has died
    Solution
    echo " export SVGA_VGPU10=0" >> ~/.bashrc
    该错误主要是由于电脑性能较差

由于在安装anaconda3的时候,默认anaconda修改路径,会导致在编译某些cmake包的时候出现错误,如:

[100%] Linking CXX executable /home/zhao/catkin_ws2/devel/lib/find_object_2d/find_object_2d
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFWriteEncodedStrip@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfShort@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFIsByteSwapped@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFFlushData@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFFreeDirectory@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteEncodedTile@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteBufferSetup@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFTileSize@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFClose@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFWriteRawStrip@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSetTagExtender@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFSwabArrayOfLong@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFTileSize64@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFReadRGBATileExt@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFStripSize@LIBTIFF_4.0'
//usr/lib/libgdal.so.20: undefined reference to `TIFFMergeFieldInfo@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.3.2.0: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'

以上是用catkin_make编译结果
或在CLION CMAKE过程中提示

runtime library [libQt5Network.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files

解决方法

  1. 在安装conda的过程中,手动添加路径而不是自动添加
export PATH=/home/zhao/anaconda3/bin${PATH:+:${PATH}}
  1. 注释conda路径(尝试不行),直接将conda库位置更名
    需要conda时再修改过来

moveit和gazebo的联合抓取仿真相关推荐

  1. UR3e+robotiq+抓取仿真实验

    首先特别感谢博主"光头明明"的帮助,本文主要按其博文"UR5+robotiq_85_gripper GAZEBO模拟视觉抓取平台仿真-1"的步骤进行.另写博文一 ...

  2. UR5+robotiq_85_gripper GAZEBO模拟视觉抓取平台仿真-1

    由于疫情原因不能进入实验室,遂学习在仿真环境gazebo下利用UR5机械臂搭建模拟平台,此模拟平台可以用于UR5机械臂通用视觉抓取平台.以下是个人总结一些观点,仅供参考. 运行环境:ubuntu16. ...

  3. UR5e+robotiq85+kinectV2+gazebo实现物体抓取【4】

    文章目录 前言 一.利用find_object_2d包提取特征 三.抓取实现 总结 前言   在前面文章1.2.3的基础上,进一步在ros平台上实现了物体抓取.通过urdf.xacro文件把robot ...

  4. ROS18.04+ Gazebo9 + robotiq85 视觉机械臂抓取仿真

    本文章参考博主光头明明的博客进行实现.但是由于明明版本为 kinetic + Gazebo7,实现时存在很多问题不好解决,因此通过此文章记录解决方法. 参考博主链接: https://blog.csd ...

  5. gazebo仿真 UR10 + robotiq140抓取物体失败:滑出或滑落

    gazebo仿真 UR10 + robotiq140抓取物体失败:滑出或滑落 机械臂(UR10+Roboiq140)抓取物体失败:爪子夹取物体,物体滑出,或机械臂网上提升时候,物体滑出,没有跟随机械臂 ...

  6. 学习记录baxter仿真 物体抓取

    笔者所用系统为 ubuntu18.04 ros melodic 1.安装依赖 baxter sdk baxter simulator 能正常在gazebo下加载baxter模型,如图 2.下载lear ...

  7. Gazebo中Robotiq使用和是否抓取物体判断

    Gazebo中Robotiq使用和是否抓取物体判断 文章目录 Gazebo中Robotiq使用和是否抓取物体判断 1.gazebo中的仿真使用 2. 仿真中如何判断抓取 3.例子 4.完结撒花 由于课 ...

  8. 机械臂论文笔记(一)【基于卷积神经网络的二指机械手 抓取姿态生成研究 】

    基于卷积神经网络的二指机械手 抓取姿态生成研究 论文下载 摘要 第1章 绪论 1.1 抓取生成国内外研究现状 1.1.1已知物体抓取生成 1.1.2相似物体抓取生成 1.1.3 未知物体抓取生成 1. ...

  9. 机器人抓取领域相关数据集

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 前言 针对机器人抓取中的检测.分割.姿态识别.抓取点检测.路径规划等任务,总结了对应的数据集,在这里分 ...

最新文章

  1. vue本地项目静态资源管理
  2. Linux(二)各种实用命令
  3. mongodb数据库淘汰_mongodb 内存数据淘汰策略
  4. leetcode剑指 Offer 11. 旋转数组的最小数字(二分查找)
  5. 阿里工程师用 8 张图告诉你如何存储、管理泛内容数据
  6. 32 岁大佬阿里二面,他答 JVM 题的姿势,令面试官很想不通。。。
  7. 更改oracle字符集为utf_oracle字符集AL16UTF16改为ZHS16GBK
  8. 笑谈ArcToolbox (5) 非我族类
  9. css画饼状图圆形,CSS样式圆形饼图百分比
  10. NHibernate从入门到精通系列(3)——第一个NHibernate应用程序
  11. 大道至简第二章-‘是懒人造就了方法’读后感
  12. 银河麒麟服务器无raid驱动安装处理
  13. 芬兰开放「线上 AI 速成班」,全球网民均可注册【智能快讯】
  14. 坚果手机 误进FastBoot Mode解决方案
  15. 【洛谷P2967】【USACO 2009 Dec】电子游戏 Video Game Troubles
  16. Ubuntu18.04启动后键盘和鼠标失灵
  17. 迅雷大乱,突现“两个迅雷”
  18. Python自动化运维脚本
  19. 科技热点周刊|Linux 30 周年、Horizon Workroom 发布、Humanoid Robot、元宇宙
  20. VScode Shortcuts for Mac

热门文章

  1. ArcGIS坡度分析(解决坡度分析80-89°高值居多)
  2. tensorflow2.0 dqn 深度强化学习 AI自动玩游戏,有详细注解
  3. mysql删除学生记录_mysql删除重复记录语句,删除除了 id 号不同,其他都相同的学生冗余信息...
  4. 视频分析代码douyin
  5. 为什么很多人工作都不开心
  6. qpython androidhelper gps_Qpython SL4A获取手机电量和GPS
  7. Monte Carlo Counterfactual Regret Minimization
  8. springboot整合redis、mybatis、@EnableScheduling定时任务,实现日访问量与日活量的统计与记录
  9. vue解决打包后文件过大的问题-使用压缩插件打包后压缩文件-compression-webpack-plugin
  10. window文件格式转换成linux格式