系统推荐

推荐系统版本:Ubuntu 24.04.3 LTS 以上稳定版本

对应ROS版本: Jazzy

源码安装

https://github.com/pycodeworld/pycoderos

https://gitee.com/pycodeworld/pycoderos

代码编译

shell
#更新软件包 sudo apt update && sudo apt upgrade # 将ros-distro替换为您的ros发行版本 [fox/humle/jazzy] sudo apt install ros-$ROS_DISTRO-rmw-cyclonedds-cpp # 如为humle: sudo apt install ros-humble-rmw-cyclonedds-cpp
编译核心功能包
shell
colcon build --symlink-install --packages-select pycodemsg pycodebot

环境准备

安装websocket桥接服务
shell
# 当已有ROS发行版本的环境变量 ROS_DISTRO,执行 sudo apt install ros-$ROS_DISTRO-rosbridge-server # 如当前ROS发行版本为humle: sudo apt install ros-humble-rosbridge-server # 如为jazzy: sudo apt install ros-jazzy-rosbridge-server

设置环境变量

进入项目src目录

shell
sudo chmod +x pycodebot.sh sudo ./pycodebot.sh setup

服务启停

在src目录下执行命令,注册pycodebot服务,并设置开机自动启动。服务注册后可通过服务方式启停pycodebot,推荐采用这种方式。
shell
sudo ./pycodebot.sh service sudo systemctl enable pycodebot

启动服务

shell
sudo systemctl start pycodebot

停止服务

shell
sudo systemctl stop pycodebot

重启服务

shell
sudo systemctl restart pycodebot

手动启停

手动前台启停pycodebot,可实时查看程序运行过程,便于问题分析和定位,实际应用中建议采用服务方式操作。

启动

如果已经启动则不会重复启动多个程序。

shell
sudo ./pycodebot.sh start

停止

shell
sudo ./pycodebot.sh stop

重启

shell
sudo ./pycodebot.sh