racebot入门教程-测试-测试GPS(室外版)
racebot入门教程-测试-测试GPS
说明:
- 介绍如何测试GPS
- 测试GPS为ublox的usb m8u GPS
相关设备:
- racebot套件,采购地址
步骤:
- 2020年04月后采购的版本不需要单独配置
- 安装驱动:
- 以racebot目录为例:
cd ~/racecar-ws/src/
git clone https://github.com/KumarRobotics/ublox
cd ..
catkin_make
确认端口:一般为ttyACM0, ttyACM1
修改m8u_rover.yaml参数:
cd ~/racecar-ws/src/ublox/ublox_gps/config
vim m8u_rover.yaml
- 修改对应端口,使用想要的frame_id
device: /dev/ttyACM0
frame_id: gps
- 修改对应波特率,要与ublox本身设置一致,ublox默认波特率为9600
uart1:
baudrate: 9600
- 保存退出
- 再修改launch文件
cd ~/racecar-ws/src/ublox/ublox_gps/launch
cp ublox_device.launch ublox_gps.launch
vim ublox_gps.launch
- 修改后内容:
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="node_name" default="gps" />
<arg name="param_file_name" default="m8u_rover" doc="name of param file, e.g. rover" />
<arg name="output" default="screen" />
<arg name="respawn" default="true" />
<arg name="respawn_delay" default="30" />
<arg name="clear_params" default="true" />
<node pkg="ublox_gps" type="ublox_gps" name="$(arg node_name)"
output="$(arg output)"
clear_params="$(arg clear_params)"
respawn="$(arg respawn)"
respawn_delay="$(arg respawn_delay)">
<rosparam command="load"
file="$(find ublox_gps)/config/$(arg param_file_name).yaml" />
</node>
</launch>
测试
- 启动GPS (旧版)
roslaunch racebot gps.launch (新版)
roslaunch ublox_gps ublox_gps.launch (旧版)
- 启动后打印的消息
[ INFO] [1575608866.273780528]: U-Blox: Opened serial port /dev/gps0
[DEBUG] [1575608866.275365648]: Configuring UART1 baud rate: 9600, In/Out Protocol: 16 / 16
[DEBUG] [1575608866.284718544]: ROM CORE 3.01 (107888), HW VER: 00080000
[DEBUG] [1575608866.285210576]: FWVER=SPG 3.01
[DEBUG] [1575608866.285436720]: PROTVER=18.00
[DEBUG] [1575608866.285497104]: GPS;GLO;GAL;BDS
[DEBUG] [1575608866.285538928]: SBAS;IMES;QZSS
[ INFO] [1575608866.285750832]: U-Blox Firmware Version: 8
[DEBUG] [1575608866.359059408]: Configuring measurement rate to 250 and nav rate to 4
[DEBUG] [1575608866.360342128]: Configuring SBAS: usage 0, max_sbas 0
[DEBUG] [1575608866.361039056]: Enabling PPP
[DEBUG] [1575608866.361741456]: Setting dynamic model to 0
[DEBUG] [1575608866.362313136]: Setting fix mode to 3
[DEBUG] [1575608866.362775120]: Setting DR Limit to 1
[DEBUG] [1575608866.363734832]: Read GNSS config.
[DEBUG] [1575608866.363813296]: Num. tracking channels in hardware: 32
[DEBUG] [1575608866.363870032]: Num. tracking channels to use: 32
[DEBUG] [1575608866.363933104]: U-Blox GNSS configuration is correct. GNSS not re-configured.
[DEBUG] [1575608866.363995760]: Saving the u-blox configuration, mask 3103, device 4
[ INFO] [1575608866.364388496]: U-Blox configured successfully.
[DEBUG] [1575608866.364448880]: Subscribing to U-Blox messages
[ERROR] [1575608866.455682960]: U-blox: received NACK: 0x06 / 0x01
[DEBUG] [1575608866.456159632]: Configuring INF messages
[ INFO] [1575608866.811267824]: INF: u-blox AG - www.u-blox.com
[ INFO] [1575608866.811805328]: INF: HW UBX-M8030 00080000
[ INFO] [1575608866.812467280]: INF: ROM CORE 3.01 (107888)
[ INFO] [1575608866.812786608]: INF: FWVER=SPG 3.01
[ INFO] [1575608866.813026608]: INF: PROTVER=18.00
[ INFO] [1575608866.813255536]: INF: GPS;GLO;GAL;BDS
[ INFO] [1575608866.813491344]: INF: SBAS;IMES;QZSS
[ INFO] [1575608866.813707408]: INF: GNSS OTP=GPS;GLO
[ INFO] [1575608866.813943952]: INF: LLC=FFFFFFFF-FFFFFFED-FFFFFFFF-FFFFFFFF-FFFFFFED
[ INFO] [1575608866.814167216]: INF: ANTSUPERV=AC SD PDoS SR
[ INFO] [1575608866.814410128]: INF: ANTSTATUS=OK
[ INFO] [1575608866.814610864]: INF: PF=3FF
- 查看话题
$ rostopic list
/diagnostics
/gps/aidalm
/gps/aideph
/gps/fix
/gps/fix_velocity
/gps/monhw
/gps/navclock
/gps/navpvt
/gps/navsat
/gps/navstatus
/rosout
/rosout_agg
- 查看话题/gps/fix内容
$ rostopic echo /gps/fix
header:
seq: 1357
stamp:
secs: 1574329668
nsecs: 67617409
frame_id: "gps"
status:
status: 0
service: 3
latitude: 23.0648413
longitude: 113.0547081
altitude: -38.78
position_covariance: [27.185796000000003, 0.0, 0.0, 0.0, 27.185796000000003, 0.0, 0.0, 0.0, 44.408896]
position_covariance_type: 2
latitude
:纬度,北纬为正数,南纬为负数
longitude
:经度,东经为正数,西经为负数
altitude
:海拔高度,单位是米
参考:
- https://github.com/KumarRobotics/ublox
- http://wiki.ros.org/ublox
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号