写在前面

目前还是在ros基础学习阶段,进度比较慢,控制对象是在某宝上买的一款六自由度机械臂,现在只是搭建了模型,按着参考书上的步骤一步一步走,还没到控制实物的部分。
现在发现基础真是非常重要,刚开始学习ros时,被一开始的各种通信机制topic、message、action等等啊弄得一头雾水,到底是书读百遍其义自见啊,重复看参考书源代码、ros.wiki和各位大神的文章,至今还是略懂皮毛,距离我能控制实物还有较长一段路要走,还有很多坑要跳。不管怎么说,知识和能力都是在跳坑和解决问题中长进的,加油坚持吧!

书接上回,六自由度机械臂ROS+Rviz+Arbotix控制器仿真中提到了arbotix虚拟控制器,这个控制器实现joint trajectory action server,通过手写client创建一个action客户端和arbotix中的服务端进行连接,action消息类型为FollowJointTrajectoryAction。

MoveIt!搭配Arbotix

如果能够通过MoveIt!实现运动规划,并且将规划结果通过FollowJointTrajectoryAction发送给机器人的Arbotix关节控制器……
所以在MoveIt!上层规划和Arbotix关节控制器之间需要一个将两者结合的接口,这个接口在MoveIt!中同样以插件的形式提供,成为moveit_simple_controller_manager。这个manager可以提供FollowJointTrajectoryAction接口,将规划轨迹以action的形式发布。


上面这张图真的非常重要!
关注上图英文中提到的两个信息。
/joint_state topic被move_group监听,move_group并不发布机器人的关节信息,这必须在机器人上实现。move_group只监听tf,tf信息由机器人发布,需要在机器人上运行robot_state_publisher节点。这些对理解下文的launch文件很有帮助。

使用Setup Assistant进行配置之后,会生成一个myrobot_moveit_config功能包,里面的demo.launch是演示启动文件,包括启动joint_state_publisher节点(发布虚拟机器人的关节状态)、robot_state_publisher节点(发布tf)、加载fake_controllers.yaml等。运行这个启动文件后,得到的节点图如下。
MoveIt!搭配Arbotix的做法就是将Arbotix控制器取代fake_controller,具体做法就是添加yaml配置文件,代码如下:

controller_list:- name: arm_controlleraction_ns: follow_joint_trajectory # 要与之前arbotix中设置的一致type: FollowJointTrajectorydefault: truejoints:- joint1- joint2- joint3- joint4- joint5- name: gripper_controlleraction_ns: gripper_actiontype: GripperCommanddefault: truejoints:- finger_joint1

然后修改myrobot_moveit_controller_manager.launch.xml文件如下,这个文件与fake_moveit_controller_manager.launch.xml文件对应:

<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 --><!-- Arbotix --><rosparam file="$(find myrobot_moveit_config)/config/myrobot_controllers.yaml"/><!-- Gazebo --><!-- <rosparam file="$(find marm_moveit_config)/config/controllers_gazebo.yaml"/> -->
</launch>

了解MoveIt!中的action

使用moveit!控制真实机械臂(4)——了解moveit!所使用的action
这篇文章写的挺好,里面挺重要一点就是,关于action接口,moveit扮演的角色是客户端,服务端才是我们需要编写的部分。搭配arbotix进行理解,moveit就是客户端,arbotix就是服务端,之间的action消息类型为FollowJointTrajectoryAction。

修改demo.launch

原自动生成的demo.launch代码如下:

<launch><!-- By default, we do not start a database (it can be large) --><arg name="db" default="false" /><!-- Allow user to specify database location --><arg name="db_path" default="$(find marm_moveit_config)/default_warehouse_mongo_db" /><!-- By default, we are not in debug mode --><arg name="debug" default="false" /><!--By default, hide joint_state_publisher's GUIMoveIt!'s "demo" mode replaces the real robot driver with the joint_state_publisher.The latter one maintains and publishes the current joint configuration of the simulated robot.It also provides a GUI to move the simulated robot around "manually".This corresponds to moving around the real robot without the use of MoveIt.--><arg name="use_gui" default="false" /><!-- Load the URDF, SRDF and other .yaml configuration files on the param server --><include file="$(find marm_moveit_config)/launch/planning_context.launch"><arg name="load_robot_description" value="true"/></include><!-- If needed, broadcast static tf for robot root --><!-- We do not have a robot connected, so publish fake joint states --><node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"><param name="/use_gui" value="$(arg use_gui)"/><rosparam param="/source_list">[/move_group/fake_controller_joint_states]</rosparam></node><!-- Given the published joint states, publish tf for the robot links --><node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" /><!-- Run the main MoveIt executable without trajectory execution (we do not have controllers configured by default) --><include file="$(find marm_moveit_config)/launch/move_group.launch"><arg name="allow_trajectory_execution" value="true"/><arg name="fake_execution" value="true"/><arg name="info" value="true"/><arg name="debug" value="$(arg debug)"/></include><!-- Run Rviz and load the default config to see the state of the move_group node --><include file="$(find marm_moveit_config)/launch/moveit_rviz.launch"><arg name="config" value="true"/><arg name="debug" value="$(arg debug)"/></include><!-- If database loading was enabled, start mongodb as well --><include file="$(find marm_moveit_config)/launch/default_warehouse_db.launch" if="$(arg db)"><arg name="moveit_warehouse_database_path" value="$(arg db_path)"/></include></launch>

参考这篇文章对上述代码进行修改。另外,由于原demo.launch启动了joint_states_publisher,用来发布模拟的关节状态,而arbotix也能发布joint_states,因此需要把上述代码中有关joint_states_publisher的代码注释掉,同时添加下述代码:

  <!-- we have a fake robot connected, and use the arbotix to pulish joint states --><node name="arbotix" pkg="arbotix_python" type="arbotix_driver" output="screen"><rosparam file="$(find myrobot_description_ultimate)/config/myrobot_arm.yaml" command="load"/><param name="sim" value="true"/></node><node name="gripper_controller" pkg="arbotix_controllers" type="gripper_controller" output="screen"><rosparam file="$(find myrobot_description_ultimate)/config/myrobot_gripper.yaml" command="load" /><param name="sim" value="true"/></node>

运行修改后的demo.launch,得到的节点图如下
终端会得到下面的输出,说明arbotix控制器添加成功,与moveit也通信成功。

使用MoveIt!+Arbotix控制六自由度机械臂相关推荐

  1. 键盘+moveit+rviz 控制六轴机械臂(仿真)

    首先下载代码:git clone https://github.com/ssz160107/catkin_ws_arm.git 打开文件夹如下图所示 打开一个终端运行mini_4wd_six_arm_ ...

  2. ardino 不用舵机控制板直接控制六自由度机械臂

    #include <Servo.h> int    angle1,angle2,angle3,angle4,angle5,angle6; int pos=10; //定义舵机 Servo ...

  3. 《Arduino开发实战指南:LabVIEW卷》6.5 基于Arduino控制6自由度机械臂

    6.5 基于Arduino控制6自由度机械臂 6.5.1 实现的功能 本节将使用LabVIEW设计实现基于Arduino的6自由度机械臂控制.本节中设计的机械臂控制主要演示Arduino在多自由度Se ...

  4. 六自由度机械臂的solidworks模型图及分享

    之前曾经在一个机械臂制造商的网站上浏览过一款机械臂 603桌面级六自由度机械臂. 于是便想使用该款机械臂来学习ros. 于是我便使用了solidworks将这款机械臂按照一比一的比例画了出来,但是长度 ...

  5. 六自由度机械臂建模仿真(matlab程序),有控制面板,标价即为真实价格,代码可流畅运行

    六自由度机械臂建模仿真(matlab程序),有控制面板,标价即为真实价格,代码可流畅运行 1.机器人运动学正逆解.动力学建模仿真与轨迹规划,雅克比矩阵求解 2.蒙特卡洛采样画出末端执行器工作空间 3. ...

  6. 大象机器人推出史上最紧凑的六自由度机械臂-mechArm

    2020年,秉持"Enjoy Robots World"的愿景和使命,在保留大部分工业型机器人功能的前提下,大象机器人与M5stack 强强联合共同出品了myCobot --全球最 ...

  7. 【详细讲解 附全部代码】【openmv控制三自由度机械臂抓取物品】硬件+软件

    前言: 这份代码很难得的是纯自己写的,虽然openmv梯子都搭成这样了也没什么大技术含量,只有一丢丢细小的逻辑.. 整体代码放在最后了,有需要的自取吧 实现功能 机械臂抓取一定范围内任意位置的物品,将 ...

  8. 六自由度机械臂基于力传感器的末端力控及拖动示教

    ​近年来,工业机器人的运用范围不断扩大,金属成形.铸造行业.冶金行业等多种工业制造领域都可以见到机器人忙碌的身影,但是随着工艺标准的提升,越来越多的制造工艺仅靠工业机器人传统的位置控制难以胜任.如:精 ...

  9. 六自由度机械臂正向运动学与姿态绘制with matlab

    如果不依赖机器人工具箱,希望自己通过作图显示机械臂某一时刻的工作姿态怎么来实现呢.首先我们知道原理是通过姿态的旋转变换以及平移变换来实现末端坐标的计算.计算完成后的将关节点连接起来便构成了机械臂在某一 ...

  10. 人的手臂的自由度的数目以及六自由度机械臂的限制

    声明:非原创,侵权必删. 摘自(9 条消息)人的手臂有几个自由度? - 知乎 https://www.zhihu.com/question/36475827/answer/77655656 人的手臂有 ...

最新文章

  1. 洛谷 题解 CF910C 【Minimum Sum】
  2. pom.xml错误:org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)的解决方法
  3. C++ Primer 5th笔记(7)chapter7 类:类的静态成员
  4. 内置类型存储空间(32位机参考)
  5. 亿佰特物联网开关电源模块:压电发声器驱动器
  6. html照片从模糊到清晰的渐变加载显示方法
  7. 力扣55. 跳跃游戏(JavaScript)
  8. 自由软件之父回归 FSF,遭 1933 人、21 家组织联名抵制!
  9. Clojure 学习入门(7)- 连接mysql
  10. 乱谈B2C系统-算是今年的总结吧
  11. YGG 与 StemsDAO 达成合作,为全球音乐创作者提供支持
  12. ESP8266 (WEMOS D1 R1 ) + L9110S_FOUR 驱动直流电机
  13. 【题解】桐桐的递归函数
  14. 如何高效的完成每日的任务?
  15. 智能电网与配网自动化工程建设
  16. C#属性简写用法 {get;set}
  17. 海龟编辑器怎么运行html,海龟编辑器绘制五角星的操作流程
  18. Google 开源最新机器学习系统 TensorFlow
  19. 三星 Samsung Galaxy Note/I9220/N7000 ZCLPP 4.0.4 国行ROM优化版
  20. Python 二次开发 SAP2000 绘制

热门文章

  1. 河南省谷歌高清卫星地图下载
  2. 64位锐捷多网卡、VMWareNat模式、ICS共享破解
  3. 按键精灵+屏幕录像专家实现数据抓包录制
  4. AdGuard Home 使用设置以及DNS测速软件
  5. 制作自己的绿色版 FireFox
  6. 计算机联锁常见的故障,计算机联锁系统常见故障及处理方法.doc
  7. 阿狸html浪漫代码,index.html
  8. 各大搜索引擎站点提交入口大全
  9. vb连接mysql教程视频_VB连接MYSQL数据的方法
  10. vue 城市级联选择 distPicker