-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
89 lines (62 loc) · 3.22 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
_ _ _ _ _
| \ | | __ _ _ _| |_(_) ___ __ _| |
| \| |/ _` | | | | __| |/ __/ _` | |
| |\ | (_| | |_| | |_| | (_| (_| | |
|_| \_|\__,_|\__,_|\__|_|\___\__,_|_|
Control code for the autonomous submarine, Marlin.
Copyright (C) 2019 AVBotz
REQUIREMENTS
Unix environment w/ connected Arduino.
Platformio. (sudo pip install -U platformio)
Tmux (recommended, sudo apt-get install tmux)
COMPILING
sudo make (local compile)
sudo make upload (compiles and uploads onto board, if connected)
sudo ./comms.sh && sudo chmod 666 /dev/ttyACM* (init serial communication)
STARTUP
After compiling and uploading, run tmux in a terminal. Split the tmux window
into two panes. Run "cat < /dev/ttyACM*" in one and "cat > /dev/ttyACM*" in
the other. The former pane is the DISPLAY pane, it will show the output from
Nautical. The latter is the COMMAND pane, it is where Nautical receives its
input.
CONFIG
All important configs are located and explained in "include/config.h".
COMMANDS
(Check "src/main.cpp" for full list of commands.)
+---------------------+----------------------+-------------------+
| Input | Description | Output |
+---------------------+----------------------+-------------------+
| a | Kill switch (1=on). | %i |
| c | Sub location. | %f %f %f %f %f %f |
| d | Sub destination. | %f %f %f %f %f %f |
| p %f | Set power (0-1). | N/A |
| s %f %f %f %f %f %f | Set destination. | N/A |
| r %f %f %f %f %f %f | Add relative state. | N/A |
| h | Raw heading (0-360). | N/A |
| x | Reset all states. | N/A |
+---------------------+----------------------+-------------------+
Each 6 %f's represent a state, or sub position. The order of the numbers is
X, Y, Z, Yaw, Pitch, Roll. This is relative to a North-East-Down coordinate
frame.
DOCUMENTATION
All of the header files are documented using Doxygen. They describe how all
of the functions work and interact each other at a higher level. More
specific implementation details are explained using regular comment blocks
in the .c/.cpp files.
For general questions about the software stack, contact David Zhang.
Questions about low-level drivers can also be directed towards Seth Girvan
(AHRS, M5) and Timothy Kanarsky (DVL).
REMOTE
Marlin can also be controlled with WASD and arrow keys over a socket. To do
this, ensure that the remote_control node on Marlin's ROS stack is running
first. Then run "sudo python manual.py".
ADDITIONAL
Nautical uses a Kalman filter to reduce noise from DVL and other sensor
readings. However, the current movement model doesn't represent Marlin's
movement well enough to provide a substantial upgrade over raw DVL data.
Nautical also needs better PID tunings or a slight change in the orientation
matrix. Marlin tends to pitch downward and strafe a bit to the right when
moving forward at high speeds.
Nautical can also be improved with quaternions over euler angles (:P).
LICENSE
This code is under the MIT license. Check the LICENSE file for more details.