必要:
- cmake - an open-source, cross-platform family of tools designed to build, test and package software.
- serial - Cross-platform, Serial Port library written in C++
- eigen - a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
- glog - a C++ implementation of the Google logging module.
clone:
git clone git@github.com:wumode/boat.git
build:
mkdir build
cd build
cmake ..
make
第八届海洋航行器设计与制作大赛B类水面组特等奖作品,感谢Evolution404和233SylviaLi 的帮助和支持,下位机固件在此
无人船的主控程序:
- 自主航行
- 上位机
- 目标追踪
- 动力定位
配置文件: config.xml
参数说明:
- gps 自主航行预置航线
- mark 记录航线
- flag
- 0 不记录
- 1 记录
- path 保存文件名
- period 记录周期(秒)
- flag
- boat
- gps_initialization
- hardware_flag
- 0 使用以下gps坐标作为初始坐标
- 1 读取一帧gps数据作为初始坐标
- hardware_flag
- frequency 控制频率
- mode 运行模式
- 1 遥控
- 2 自主
- 3 追踪
- socket
- send_frequency 发送频率
- host 地址
- port 端口
- serial
- port 串口号
- baud 波特率
- gps_initialization
串口通信封装在类SerialCommunication中,串口通信协议如下:
帧头 | 功能字 | 长度 | 数据 | 校验 |
---|---|---|---|---|
0xAA,0xAF | flag | length | data | sum |
socket通信封装在类SocketCommunication中, 发送和接收的例子在send.json和receive.json
在boat目录下执行
sudo build/./Ship
log/Ship.INFO
Copyright 2019 Sea Knight from HIT
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.