launch add GDB 2020-11-09

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处写东西,所以会产生段错误
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。