欢迎来到天天文库
浏览记录
ID:42476543
大小:377.51 KB
页数:12页
时间:2019-09-15
《ROS turtlebot_follower :让机器人跟随我们移动》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、ROSturtlebot_follower:让机器人跟随我们移动ROSturtlebot_follower学习首先在catkin_ws/src目录下载源码了解代码见注释(其中有些地方我也不是很明白)follower.cpp#include#include#include#include#include2、e.h>#include#include#include"dynamic_reconfigure/server.h"#include"turtlebot_follower/FollowerConfig.h"#includenamespaceturtlebot_follower{//*Theturtlebotfol3、lowernodelet./***Theturtlebotfollowernodelet.Subscribestopointclouds*fromthe3dsensor,processesthem,andpublishescommandvel*messages.*/classTurtlebotFollower:publicnodelet::Nodelet{public:/*!*@briefTheconstructorforthefollower.*Constructorforthefollower.4、*/TurtlebotFollower():min_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、aximumypositionofthepointsinthebox.*/doublemin_x_;/**6、7、preventsmotorcommands启用/禁用追踪;只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
2、e.h>#include#include#include"dynamic_reconfigure/server.h"#include"turtlebot_follower/FollowerConfig.h"#includenamespaceturtlebot_follower{//*Theturtlebotfol
3、lowernodelet./***Theturtlebotfollowernodelet.Subscribestopointclouds*fromthe3dsensor,processesthem,andpublishescommandvel*messages.*/classTurtlebotFollower:publicnodelet::Nodelet{public:/*!*@briefTheconstructorforthefollower.*Constructorforthefollower.
4、*/TurtlebotFollower():min_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、aximumypositionofthepointsinthebox.*/doublemin_x_;/**6、7、preventsmotorcommands启用/禁用追踪;只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
5、aximumypositionofthepointsinthebox.*/doublemin_x_;/**6、7、preventsmotorcommands启用/禁用追踪;只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
6、7、preventsmotorcommands启用/禁用追踪;只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
7、preventsmotorcommands启用/禁用追踪;只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_veltopic为空*///Serviceforstart/stopfollowingros::ServiceServerswitch_srv_;//Dynamicreconfigureserver动态配置服务dynamic_reconfigure::Server8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
8、owerConfig>*config_srv_;/*!*@briefOnInitmethodfromnodehandle.*OnInitmethodfromnodehandle.Setsuptheparameters*andtopics.*初始化handle,参数,和话题*/virtualvoidonInit(){ros::NodeHandle&nh=getNodeHandle();ros::NodeHandle&private_nh=getPrivateNodeHa
此文档下载收益归作者所有