ros高效编程一书第7章完结附第八章

两个action

他这里用到了两个action pickup和place
http://wiki.ros.org/moveit_msgs
Messages, services and actions used by MoveIt
action介绍:xxx

http://wiki.ros.org/actionlib

#目标值
int32 num
---
#最终结果
int32 result
---
#连续反馈
float64 progress_bar
  c++
typedef actionlib::SimpleActionServer<demo01_action::AddIntsAction> Server;
typedef actionlib::SimpleActionClient<chores::DoDishesAction> Client;
#include "demo01_action/AddIntsAction.h"

 Client client("do_dishes", true); // true -> don't need ros::spin()
 Server server(nh,"addInts",boost::bind(&cb,_1,&server),false)
  
  py 
from actionlib import SimpleActionClient, GoalStatus
 self._grasps_ac = SimpleActionClient('/moveit_simple_grasps_server/generate', GenerateGraspsAction)

from chores.msg import DoDishesAction, DoDishesGoal 
client = actionlib.SimpleActionClient('do_dishes', DoDishesAction)

from demo01_action.msg import *
client = actionlib.SimpleActionClient("addInts",AddIntsAction)

自己的action

xxx.action文件
配置完编译生成中间文件
编译后会生成一些中间文件。

msg文件(.../工作空间/devel/share/包名/msg/xxx.msg)
C++ 调用的文件(.../工作空间/devel/include/包名/xxx.h):
C++ 调用的文件(.../工作空间/devel/include/包名/xxx.h):
vscode配置 需要像之前自定义 msg 实现一样配置settings.json 文件

move api

他这里分c++和python两个版本的。
moveit::planning_interface::MoveGroupInterface Class Reference

古月居,包括moveit官方教程里面用到的是pick
http://docs.ros.org/en/kinetic/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroupInterface.html
High level actions that trigger a sequence of plans and actions.

 moveit::planning_interface::MoveGroupInterface group("panda_arm");
moveit::planning_interface::MoveGroupInterface& move_group
move_group.pick("object", grasps);
////////////////////////////////////////////////////
 arm = MoveGroupCommander(GROUP_NAME_ARM)
 result = arm.pick(target_id, grasps)

http://docs.ros.org/en/kinetic/api/moveit_commander/html/classmoveit__commander_1_1move__group_1_1MoveGroupCommander.html

命名空间 类 对象

https://www.ncnynl.com/archives/201610/972.html
https://www.ncnynl.com/archives/201610/1016.html
namespace
里面有class /function/ variable
classe
里面有各种函数
https://blog.csdn.net/u010936131/article/details/79076453

模式区分

他这个所谓的demo演示模式其实就是moveit config自动生成的launch文件

演示模式就是只运行 rviz
后面又分别运行了相当于
gazebo.launch
moveit_rviz.launch
grasp generator.launch
pick and place.py
四个文件。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值