2025年4月2日 星期三 乙巳(蛇)年 正月初三 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 系统应用 > Linux

ubuntu18.04开机自启动sh脚本运行roslaunch rosrun

时间:02-03来源:作者:点击数:44

1. 在终端GUI设置,输入如下命令

  • gnome-session-properties

2. 编辑开机启动文件

添加一行, 举例pixracer_connection

在这里插入图片描述

3. 示例参数

在这里插入图片描述

4. sh文件示例

pixracer_connection.sh如下

  • #!/bin/bash
  • ### BEGIN INIT INFO
  • # Provides: CIUS
  • # Short-Description: CIUS
  • # Description:
  • # Required-Start: $remote_fs $local_fs
  • # Required-Stop: $remote_fs $local_fs
  • # Default-Start: 2 3 4 5
  • # Default-Stop: 0 1 6
  • ### END INIT INFO
  • source /opt/ros/melodic/setup.bash
  • source /home/nvidia/catkin_ws/devel/setup.bash
  • roslaunch mavros px4.launch
  • exit 0

5. 问题

目前只能在一个终端中,实现roslaunch运行. 若要开多个终端,会出现开不起来的情况,会失败.

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门