launch-prefix="xterm -e gdb --args" :
run your node in a gdb in a separate xterm window, manually type run to start it
添加之后:
<node pkg="waypoint_follower" type="pure_persuit" name="pure_pursuit" output="screen" launch-prefix="xterm -e gdb --args">
<param name="is_linear_interpolation" value="$(arg is_linear_interpolation)"/>
</node>
运行时报错:
RLException: Roslaunch got a 'No such file or directory' error while attempting to run:
xterm -e gdb --args /home/grant/odometry_calibration_ws/devel/lib/odometry_calibration/encoder_odometer_sm_check __name:=calibrate_geometry_odom_lidar __log:=/home/grant/.ros/log/061af66a-65e5-11eb-9785-1cbfc059d643/calibrate_geometry_odom_lidar-2.log
Please make sure that all the executables in this command exist and have
executable permission. This is often caused by a bad launch-prefix.
The traceback for the exception was written to the log file
似乎是没有找到xterm的路径,Ubuntu使用的是gnome terminal,所以将命令修改为:
<node pkg="odometry_calibration" type="encoder_odometer_sm_check" name="calibrate_geometry_odom_lidar"
output="screen" launch-prefix="gnome-terminal -x gdb --args" />
在gdb页面,按住鼠标右键,选择huge。
检测是否install xterm or gdb
添加一段运行时报错的代码,追踪实现流程:
char *p;
p = NULL;
*p = 'x'; //往内存地址0处写东西,所以会产生段错误
网友评论