跳到主要内容
版本:V2.0.4.x

8.2 一键启动

8.2.1 一键启动功能

手动一键启动,启动之前确保自启动服务(proc_manager.service)已被 disable 及 stop (ps -ef | grep ros 看看有没有 ros 相关的进程在 ,如果有,kill 掉):

手动启动进程管理器:

ROS2:

cd ros2ws
source install/setup.bash
ros2 launch proc_manager proc_manager.launch.py

8.2.2 自启动功能启用/关闭

自启动功能默认被禁用,使用以下方法开启、关闭

  1. 使能自启动

    sudo systemctl enable proc_manager.service
  2. 禁用自启动

    sudo systemctl disable proc_manager.service

8.2.3 服务启动配置说明

自启动服务配置如下,配置位于:

/home/ubuntu/rosws/install/share/diagnose/param/proc_manager.json , 定义如下:

其中:

  1. config:(定义全局配置参数):

    {
    "config": {
    "audio_player": "192.168.41.2", // 定义语音播放设备是在 192.168.41.2( Orin)上
    "audio_path": "/home/nvidia/data/speech", // 定义语音播放音频目录在/home/nvidia/data/speech
    "audio_list": ["0.mp3", "1.mp3", "2.mp3", "3.mp3", "4.mp3"] // 定义遥控器控制的语音文件列表
    },
    }

  2. proc:(定义服务进程):

    {
    "proc": [
    {
    "name": "power_board", // 服务名称
    "enable": true, // true:生效,false:忽略
    "shell": "roslaunch power_board power_board.launch", // shell:要执行的 shell 命令
    "boot_start": true, // 开机是否自动启动,true:是 ,false:否
    "ready_topic": "power_board_state" // 服务状态 ready 的 topic ,等待该 topic 信号标识服务已启动完成
    }, {
    "name": "usb_s bus",
    "enable": true,
    "shell": "roslaunch usb_sb us s bus.launch",
    "boot_start": true
    }, {
    "name": "body_control",
    "enable": true,
    "shell": "roslaunch body_control body_no_s bus.launch",
    "boot_start": false,
    "ready_topic": "bodycontrol_state",
    "ready_timeout": 20
    }, {
    "name": "motion",
    "enable": true,
    "shell": "roslaunch motion_control motion.launch"
    }
    ],
    }