- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ROSturtlebot_follower让机器人跟随我们移动
ROS turtlebot_follower :让机器人跟随我们移动
ROS turtlebot_follower 学习
首先在catkin_ws/src目录下载源码
了解代码见注释(其中有些地方我也不是很明白)
follower.cpp
#include ros/ros.h
#include pluginlib/class_list_macros.h
#include nodelet/nodelet.h
#include geometry_msgs/Twist.h
#include sensor_msgs/Image.h
#include visualization_msgs/Marker.h
#include turtlebot_msgs/SetFollowState.h
#include dynamic_reconfigure/server.h
#include turtlebot_follower/FollowerConfig.h
#include depth_image_proc/depth_traits.h
namespace turtlebot_follower
{
//* The turtlebot follower nodelet.
/**
* The turtlebot follower nodelet. Subscribes to point clouds
* from the 3dsensor, processes them, and publishes command vel
* messages.
*/
class TurtlebotFollower : public nodelet::Nodelet
{
public:
/*!
* @brief The constructor for the follower.
* Constructor for the follower.
*/
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()
{
delete config_srv_;
}
private:
double min_y_; /** The minimum y position of the points in the box. */
double max_y_; /** The maximum y position of the points in the box. */
double min_x_; /** The minimum x position of the points in the box. */
double max_x_; /** The maximum x position of the points in the box. */
double max_z_; /** The maximum z position of the points in the box. 框中 点的最大z位置,以上四个字段用来设置框的大小*/
double goal_z_; /** The distance away from the robot to hold the centroid 离机器人的距离,以保持质心*/
double z_scale_; /** The scaling factor for translational robot speed 移动机器人速度的缩放系数*/
double x_scale_; /** The scaling factor for rotational robot speed 旋转机器人速度的缩放系数*/
bool enabled_; /** Enable/disable following; just prevents motor commands 启用/禁用追踪; 只是阻止电机命令,置为false后,机器人不会移动,/mobile_base/mobile_base_controller/cmd_vel topic 为空*/
// Service for start/stop following
ros::Se
您可能关注的文档
- MySQL数据库系统及应用第二套作业(3—4单元).docx
- myeclipse框架搭建步骤.docx
- MyEclipse2013下搭建SSH框架.doc
- l联想硬盘保护系统edu8.0安装教程.docx
- netty技术.docx
- NC环境搭建.docx
- NC疑难杂症.doc
- NGS的这10年.docx
- NEUERO固定式架车机维护保养规程-标准.doc
- ODIKM二次开发手册.doc
- 英语人教PEP版八年级(上册)Unit4+writing+写作.pptx
- 人美版美术四年级(上册)8 笔的世界 课件 (1).pptx
- 人美版美术七年级(上册)龙的制作.pptx
- 英语人教PEP版六年级(上册)Unit 2 第一课时.pptx
- 数学苏教版三年级(上册)3.3 长方形和正方形周长的计算 苏教版(共12张PPT).pptx
- 音乐人教版八年级(上册)青春舞曲 课件2.pptx
- 音乐人教版四年级(上册) 第一单元 音乐知识 附点四分音符|人教版.pptx
- 英语人教PEP版四年级(上册)Unit 6 Part B let's learn 1.pptx
- 道德与法治人教版二年级(上册)课件-3.11大家排好队部编版(共18张PPT).pptx
- 人美版美术七年级(上册)《黄山天下奇》课件1.pptx
文档评论(0)