odom0_config: [false, false, false, false, false, false, false, false, false, false, false, true, false, false, false]
时间: 2023-12-28 11:05:11 浏览: 91
这是一个ROS中的配置文件,用于配置机器人的odometry(里程计)数据。其中,odom0_config是一个长度为15的布尔型数组,用于指定ROS消息中哪些数据是有效的。具体地,数组中每个元素对应于ROS消息中的一个数据,例如第一个元素对应于ROS消息中的x轴线速度,第三个元素对应于ROS消息中的z轴角速度。如果一个元素为true,则表示对应的数据有效;如果为false,则表示无效。在这里,数组中只有第12个元素为true,表示ROS消息中只有yaw角度是有效的,其他数据都无效。
相关问题
请解释这段代码的含义“TebLocalPlannerROS: odom_topic: odom map_frame: map # Trajectory teb_autosize: True dt_ref: 0.3 # Desired trajectory time resolution dt_hysteresis: 0.03 #The hysteresis that automatically adjusts the size according to the current time resolution, usually approx. It is recommended to use 10% of dt ref. global_plan_overwrite_orientation: True # Cover the direction of the local sub-goals provided by the global planner allow_init_with_backwards_motion: False max_global_plan_lookahead_dist: 3.0 # Specify the maximum length of the global plan subset considered for optimization feasibility_check_no_poses: 5 # default:4 The number of attitude feasibility analysis for each sampling interval, # Robot max_vel_x: 0.2 #max_vel_x (double, default: 0.4) max_vel_x_backwards: 0.07 #max_vel_x_backwards (double, default: 0.2) acc_lim_x: 1.0 #acc_lim_x (double, default: 0.5) max_vel_theta: 1.0 #max_vel_theta (double, default: 0.3) acc_lim_theta: 0.5 #acc_lim_theta (double, default: 0.5) min_turning_radius: 0.38 # min_turning_radius (double, default: 0.0) diff-drive: 0 max_steer_angle = 45 度,car_length = 0.35 ----> Redius_min= 0.35”
这段代码是一个ROS的配置文件,用于配置TebLocalPlannerROS局部路径规划器的参数。
具体含义如下:
- odom_topic: 里程计话题的名称为 odom。
- map_frame: 地图坐标系的名称为 map。
- teb_autosize: 是否自动调整轨迹的长度。
- dt_ref: 规划轨迹的参考时间分辨率。
- dt_hysteresis: 自动调整轨迹长度的滞后时间,通常为参考时间分辨率的10%。
- global_plan_overwrite_orientation: 是否覆盖全局规划器提供的局部目标点的方向。
- allow_init_with_backwards_motion: 是否允许以后退的方式开始规划。
- max_global_plan_lookahead_dist: 全局规划器提供的路径子集的最大长度。
- feasibility_check_no_poses: 每个采样间隔进行姿态可行性分析的次数。
- max_vel_x: 最大线速度。
- max_vel_x_backwards: 最大后退速度。
- acc_lim_x: 最大线加速度。
- max_vel_theta: 最大角速度。
- acc_lim_theta: 最大角加速度。
- min_turning_radius: 最小转弯半径。
- diff-drive: 是否是差速机器人。
- max_steer_angle: 最大转向角度。
- car_length: 车辆长度。
- Redius_min: 最小转弯半径。
给下列程序添加注释:void DWAPlannerROS::initialize( std::string name, tf2_ros::Buffer* tf, costmap_2d::Costmap2DROS* costmap_ros) { if (! isInitialized()) { ros::NodeHandle private_nh("~/" + name); g_plan_pub_ = private_nh.advertise<nav_msgs::Path>("global_plan", 1); l_plan_pub_ = private_nh.advertise<nav_msgs::Path>("local_plan", 1); tf_ = tf; costmap_ros_ = costmap_ros; costmap_ros_->getRobotPose(current_pose_); // make sure to update the costmap we'll use for this cycle costmap_2d::Costmap2D* costmap = costmap_ros_->getCostmap(); planner_util_.initialize(tf, costmap, costmap_ros_->getGlobalFrameID()); //create the actual planner that we'll use.. it'll configure itself from the parameter server dp_ = boost::shared_ptr<DWAPlanner>(new DWAPlanner(name, &planner_util_)); if( private_nh.getParam( "odom_topic", odom_topic_ )) { odom_helper_.setOdomTopic( odom_topic_ ); } initialized_ = true; // Warn about deprecated parameters -- remove this block in N-turtle nav_core::warnRenamedParameter(private_nh, "max_vel_trans", "max_trans_vel"); nav_core::warnRenamedParameter(private_nh, "min_vel_trans", "min_trans_vel"); nav_core::warnRenamedParameter(private_nh, "max_vel_theta", "max_rot_vel"); nav_core::warnRenamedParameter(private_nh, "min_vel_theta", "min_rot_vel"); nav_core::warnRenamedParameter(private_nh, "acc_lim_trans", "acc_limit_trans"); nav_core::warnRenamedParameter(private_nh, "theta_stopped_vel", "rot_stopped_vel"); dsrv_ = new dynamic_reconfigure::Server<DWAPlannerConfig>(private_nh); dynamic_reconfigure::Server<DWAPlannerConfig>::CallbackType cb = boost::bind(&DWAPlannerROS::reconfigureCB, this, _1, 2); dsrv->setCallback(cb); } else{ ROS_WARN("This planner has already been initialized, doing nothing."); } }
/**
* @brief 初始化DWAPlannerROS的函数
*
* @param name: 节点名字
* @param tf: tf2_ros::Buffer类型指针,用于获取tf信息
* @param costmap_ros: costmap_2d::Costmap2DROS类型指针,用于获取costmap信息
*/
void DWAPlannerROS::initialize(std::string name, tf2_ros::Buffer* tf, costmap_2d::Costmap2DROS* costmap_ros) {
// 判断是否已经初始化
if (!isInitialized()) {
// 创建私有命名空间
ros::NodeHandle private_nh("~/" + name);
// 创建两个Publisher,用于发布全局规划和局部规划
g_plan_pub_ = private_nh.advertise<nav_msgs::Path>("global_plan", 1);
l_plan_pub_ = private_nh.advertise<nav_msgs::Path>("local_plan", 1);
// 获取tf信息和costmap信息
tf_ = tf;
costmap_ros_ = costmap_ros;
costmap_ros_->getRobotPose(current_pose_);
// 更新costmap
costmap_2d::Costmap2D* costmap = costmap_ros_->getCostmap();
// 初始化planner_util_
planner_util_.initialize(tf, costmap, costmap_ros_->getGlobalFrameID());
// 创建DWAPlanner对象,从参数服务器上获取参数
dp_ = boost::shared_ptr<DWAPlanner>(new DWAPlanner(name, &planner_util_));
if (private_nh.getParam("odom_topic", odom_topic_)) {
odom_helper_.setOdomTopic(odom_topic_);
}
// 设置initialized_为true
initialized_ = true;
// 警告已经被弃用的参数
nav_core::warnRenamedParameter(private_nh, "max_vel_trans", "max_trans_vel");
nav_core::warnRenamedParameter(private_nh, "min_vel_trans", "min_trans_vel");
nav_core::warnRenamedParameter(private_nh, "max_vel_theta", "max_rot_vel");
nav_core::warnRenamedParameter(private_nh, "min_vel_theta", "min_rot_vel");
nav_core::warnRenamedParameter(private_nh, "acc_lim_trans", "acc_limit_trans");
nav_core::warnRenamedParameter(private_nh, "theta_stopped_vel", "rot_stopped_vel");
// 创建dynamic_reconfigure::Server对象,用于动态参数配置
dsrv_ = new dynamic_reconfigure::Server<DWAPlannerConfig>(private_nh);
dynamic_reconfigure::Server<DWAPlannerConfig>::CallbackType cb = boost::bind(&DWAPlannerROS::reconfigureCB, this, _1, 2);
dsrv_->setCallback(cb);
} else {
// 如果已经初始化,输出警告信息
ROS_WARN("This planner has already been initialized, doing nothing.");
}
}
阅读全文