今天将最新版Noetic版本的teb_local_planner功能包放到工作空间内进行编译时产生了以下报错:
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp: In member function ‘void teb_local_planner::TebConfig::reconfigure(teb_local_planner::TebLocalPlannerReconfigureConfig&)’:
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:202:57: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘feasibility_check_lookahead_distance’
202 | trajectory.feasibility_check_lookahead_distance = cfg.feasibility_check_lookahead_distance;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:204:45: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘control_look_ahead_poses’
204 | trajectory.control_look_ahead_poses = cfg.control_look_ahead_poses;
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:205:55: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘prevent_look_ahead_poses_near_goal’
205 | trajectory.prevent_look_ahead_poses_near_goal = cfg.prevent_look_ahead_poses_near_goal;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:218:43: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘use_proportional_saturation’
218 | robot.use_proportional_saturation = cfg.use_proportional_saturation;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:219:11: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘max_vel_trans’; did you mean ‘max_vel_theta’?
219 | if (cfg.max_vel_trans == 0.0)
| ^~~~~~~~~~~~~
| max_vel_theta
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:222:9: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘max_vel_trans’; did you mean ‘max_vel_theta’?
222 | cfg.max_vel_trans = robot.max_vel_x;
| ^~~~~~~~~~~~~
| max_vel_theta
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:224:29: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘max_vel_trans’; did you mean ‘max_vel_theta’?
224 | robot.max_vel_trans = cfg.max_vel_trans;
| ^~~~~~~~~~~~~
| max_vel_theta
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:230:42: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘trans_stopped_vel’
230 | goal_tolerance.trans_stopped_vel = cfg.trans_stopped_vel;
| ^~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:231:42: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘theta_stopped_vel’
231 | goal_tolerance.theta_stopped_vel = cfg.theta_stopped_vel;
| ^~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:244:52: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘obstacle_proximity_ratio_max_vel’
244 | obstacles.obstacle_proximity_ratio_max_vel = cfg.obstacle_proximity_ratio_max_vel;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:245:50: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘obstacle_proximity_lower_bound’
245 | obstacles.obstacle_proximity_lower_bound = cfg.obstacle_proximity_lower_bound;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:246:50: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘obstacle_proximity_upper_bound’
246 | obstacles.obstacle_proximity_upper_bound = cfg.obstacle_proximity_upper_bound;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:269:46: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘weight_velocity_obstacle_ratio’
269 | optim.weight_velocity_obstacle_ratio = cfg.weight_velocity_obstacle_ratio;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:277:47: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘max_number_plans_in_current_class’
277 | hcp.max_number_plans_in_current_class = cfg.max_number_plans_in_current_class;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:283:44: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘selection_dropping_probability’
283 | hcp.selection_dropping_probability = cfg.selection_dropping_probability;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:299:46: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘divergence_detection_enable’
299 | recovery.divergence_detection_enable = cfg.divergence_detection_enable;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gly/catkin_ws/src/local_planner/teb_local_planner-noetic-devel/src/teb_config.cpp:300:55: error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘divergence_detection_max_chi_squared’
300 | recovery.divergence_detection_max_chi_squared = cfg.divergence_detection_max_chi_squared;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [local_planner/teb_local_planner-noetic-devel/CMakeFiles/teb_local_planner.dir/build.make:128:local_planner/teb_local_planner-noetic-devel/CMakeFiles/teb_local_planner.dir/src/teb_config.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:726:local_planner/teb_local_planner-noetic-devel/CMakeFiles/teb_local_planner.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
Invoking "make -j1 -l1" failed
1、报错内容
总结一下大致是 error: ‘class teb_local_planner::TebLocalPlannerReconfigureConfig’ has no member named ‘xxx’这一类的错误
2、报错原因
报错原因是之前采用了以下语句,在ROS默认路径下安装了旧版本的teb_local_palnner,使得在/opt/ros/noetic/include路径下存在着旧版本teb_local_palnner所对应的一系列头文件
sudo apt install ros-noetic-teb-local-planner
新版本的teb_local_palnner添加了上述报错内容中的参数,然而这些参数在旧版本的TebLocalPlannerReconfigureConfig.h文件中编写的teb_local_planner::TebLocalPlannerReconfigureConfig类中是不存在的,因此,当我们在自己创建的工作空间下第一次进行新的teb_local_palnner包的编译时,由于之前没有编译过,自然也就没有生成这个新包对应的TebLocalPlannerReconfigureConfig.h文件,而在ROS的默认路径中却存在旧版本的这个文件,旧版本的这个文件中缺少新加入的参数,因此发送报错。
3、报错内容解决方法
(1)、打开一个新的终端,执行以下语句,进入存放该旧版头文件的目录下
cd /opt/ros/noetic/include
(2)、执行以下语句删除旧版teb_local_palnner包的相关头文件
sudo rm -rf ./teb_local_planner/
4、方法验证
此时,在存放新的teb_lcoal_planner功能包的工作空间下进行编译,即可成功编译
编译成功后在工作空间的devel/include/teb_local_planner文件夹下生成了新的TebLocalPlannerReconfigureConfig.h