欢迎来到天天文库
浏览记录
ID:57695768
大小:38.00 KB
页数:9页
时间:2020-09-01
《ROS-turtlebot-follower-:让机器人跟随我们移动.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、ROSturtlebot_follower:让机器人跟随我们移动ROSturtlebot_follower学习首先在catkin_ws/src目录下载源码了解代码见注释(其中有些地方我也不是很明白)follower.cpp#include#include#include#include#include#inc
2、lude#include#include"dynamic_reconfigure/server.h"#include"turtlebot_follower/FollowerConfig.h"#includenamespaceturtlebot_follower{//*Theturtlebotfollowernodelet./**
3、*Theturtlebotfollowernodelet.Subscribestopointclouds*fromthe3dsensor,processesthem,andpublishescommandvel*messages.*/classTurtlebotFollower:publicnodelet::Nodelet{public:/*!*@briefTheconstructorforthefollower.*Constructorforthefollower.*/TurtlebotFollower():mi
4、n_y_(0.1),max_y_(0.5),min_x_(-0.2),max_x_(0.2),max_z_(0.8),goal_z_(0.6),z_scale_(1.0),x_scale_(5.0){}~TurtlebotFollower(){deleteconfig_srv_;}private:doublemin_y_;/**5、ox.*/doublemin_x_;/**6、troid离机器人的距离,以保持质心*/doublez_scale_;/**7、器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server*config_srv_;/*!*@briefOnInitmethodfromnodeha8、ndle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
5、ox.*/doublemin_x_;/**6、troid离机器人的距离,以保持质心*/doublez_scale_;/**7、器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server*config_srv_;/*!*@briefOnInitmethodfromnodeha8、ndle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
6、troid离机器人的距离,以保持质心*/doublez_scale_;/**7、器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server*config_srv_;/*!*@briefOnInitmethodfromnodeha8、ndle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
7、器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server*config_srv_;/*!*@briefOnInitmethodfromnodeha
8、ndle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
此文档下载收益归作者所有