项目简介
本项目是基于ROS Noetic的smallBot驱动系统,能够实现对smallBot底盘的控制以及相关数据的处理与获取。
项目的主要特性和功能
主要特性
- 可通过ROS控制底盘,默认订阅
cmd_vel
话题。 - 实现里程计功能,可通过话题或TF获取相关数据。
- 具备电量监控功能。
主要功能
driver_node
:接收geometry_msgs/Twist
消息,依据协议将数据转化并通过串口发送到下位机;从下位机读取数据,转化为TF数据和nav_msgs/Odometry
话题。serial_control
:类似串口调试助手,实现协议的所有功能,用于调试小车。
安装使用步骤
安装步骤
- 安装所需的ROS库,缺啥用
apt install
安装。 - 安装Eigen3用于数学计算:
sudo apt install libeigen3-dev
。 - 安装boost库,主要用于串口通信。
- 确保g++支持C++17及以上。
- 复制项目代码:
git clone xxx cd xxx/src cd ws catkin_make
使用步骤
bash
rosrun smallBotRosDriver control_serial port baud_rate # 启动控制台版的串口调试助手
roslaunch smallBotRosDriver driver.launch # 启动ROS节点
参数设置
在launch/driver.launch
文件中可设置以下参数:
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| port | str | 串口名字 |
| baud_rate | int | 波特率 |
| cmd | str | 速度的话题名字 |
| timeout_millseconds | int | 超时重发的最长等待时间,单位毫秒 |
| send_queue_size | int | 发送队列的长度 |
| reductionRate | double | 减速度比 |
| L | double | 车子半径 |
| wheelR | double | 轮子半径 |
| tpr | double | 多少个tick一周 |
| odom_name | str | odom的话题名 |
| odom_rate | double | odom的采样频率,单位Hz |
| odom_frame | str | odom的frame名 |
| child_frame | str | odom的child frame名 |
| sendTF | bool | 是否发TF |
| sendOdom | bool | 是否发话题 |
| batt_rate | double | 电池电量更新频率 |
| batt_raw_name | str | 电池电压的话题 |
| batt_percent_name | str | 电池电量百分比的话题 |
| batt_table_path | str | 电池电量查询表 |
下载地址
点击下载 【提取码: 4003】【解压密码: www.makuang.net】