Skip to content

Commit 61562b4

Browse files
committed
Added some documentation
1 parent 9b64c00 commit 61562b4

18 files changed

Lines changed: 263 additions & 70 deletions

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ debug:
4646
$(MAKE) $(MAKEFILE) DEBUGFLAG="-g -D DEBUG"
4747
@echo "$(TARGET) Make Debug Complete"
4848

49+
docs:
50+
@cd docs; doxygen Doxyfile
51+
4952
install:
5053
@$(INSTALLDIR) $(DESTDIR)$(prefix)/bin
5154
@$(INSTALL) $(TARGET) $(DESTDIR)$(prefix)/bin
@@ -66,3 +69,4 @@ runonboot:
6669
@$(LINK) $(DESTDIR)$(prefix)/bin/$(TARGET) $(LINKDIR)/$(LINKNAME)
6770
@echo "$(TARGET) Set to Run on Boot"
6871

72+
.PHONY: all debug docs clean install uninstall runonboot

README.md

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,78 @@
1-
Multirotor Flight Controller for the Robotics Cape
1+
# Documentation
2+
[Documentation for rc_pilot](http://www-personal.umich.edu/~ghaggin/rc_pilot/)
23

3-
Please don't use this and expect it to work the way you want it to!!!!!
4-
I wrote this purely for my own use. NOT FOR PUBLIC USE!!!!
5-
It comes with no warranty, no manual, and I won't answer questions about
6-
how it works. If it breaks something, you get to keep both pieces.
4+
# Setup
5+
## Install dependencies on Beaglebone:
76

8-
However, enough people have asked me for it so here it is.
7+
```shell
8+
$ sudo apt install libjson-c-dev libjson-c3
9+
```
910

11+
## Install librobotcontrol on Beaglebone:
1012

11-
Note: depends on libjson-c-dev & libjson-c3
12-
sudo apt install libjson-c-dev libjson-c3
13+
The repo for the library is located on the [Strawson Design](https://github.com/StrawsonDesign/librobotcontrol) GitHub page. There is a bug in the 1.0.4 release version (```rc_duplicate_filter``` fails for initialized filter) so [install librobotcontrol from source](http://strawsondesign.com/docs/librobotcontrol/installation.html).
1314

14-
also libroboticscape >v0.4.0
15+
16+
## Transfer rc_pilot source to Beaglebone:
17+
In the scripts folder there are some convenient scripts for moving files to and from the vehicle. These scripts were build and tested on Ubuntu 19.04 but have not been tested on any other system. They should work on any system with bash and rsync. To transfer the files to the vehicle run:
18+
19+
```shell
20+
$ ./scripts/transfer_rcpilot [usb|wifi]
21+
```
22+
23+
## Build on Beaglebone (from project directory):
24+
25+
```shell
26+
$ make
27+
```
28+
29+
## Run RC_pilot:
30+
31+
```shell
32+
$ cd bin
33+
$ sudo ./rc_pilot -s ../settings/quad_settings.json
34+
```
35+
36+
# Miscellaneous
37+
## Building docs:
38+
39+
Make sure that doxygen is installed on your system and run
40+
41+
``` shell
42+
$ make docs
43+
```
44+
45+
Open the docs with the web browser of your choice
46+
47+
```shell
48+
$ firefox docs/html/index.html
49+
$ google-chrome docs/html/index.html
50+
```
51+
52+
## (COMING SOON) Testing:
53+
Test cases are written using the [Boost 1.66](https://www.boost.org/users/history/version_1_66_0.html) testing suite. Look at make target test for system install location. This suite is not written with portability in mind so it may take some tweaking to get it to work right now. Typically, installing boost with the option ```--prefix=/usr/local``` should put the libraries and headers in the correct location but don't count on it.
54+
55+
Run the test suit with the make target:
56+
```shell
57+
$ make test
58+
```
59+
60+
### Adding Test Modules
61+
62+
To add a test modules, create a new file <module_name>_test.cpp and format it as follows:
63+
64+
```c++
65+
#include <boost/test/unit_test.hpp>
66+
67+
BOOST_AUTO_TEST_SUIT(Test_<module_name>)
68+
69+
BOOST_AUTO_TEST_CASE(test1){...}
70+
71+
BOOST_AUTO_TEST_CASE(test2){...}
72+
73+
...
74+
75+
BOOST_AUTO_TEST_CASE_END()
76+
```
77+
78+
The make target will compile each test module into a single executable and run all test cases simultaneously.

docs/Doxyfile

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ STRIP_FROM_PATH =
171171
# specify the list of include paths that are normally passed to the compiler
172172
# using the -I flag.
173173

174-
STRIP_FROM_INC_PATH = ../library/include/
174+
STRIP_FROM_INC_PATH = ../include
175175

176176
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
177177
# less readable) file names. This can be useful is your file systems doesn't
@@ -226,7 +226,7 @@ SEPARATE_MEMBER_PAGES = NO
226226
# uses this value to replace tabs by spaces in code fragments.
227227
# Minimum value: 1, maximum value: 16, default value: 4.
228228

229-
TAB_SIZE = 8
229+
TAB_SIZE = 4
230230

231231
# This tag can be used to specify a number of aliases that act as commands in
232232
# the documentation. An alias has the form:
@@ -531,7 +531,7 @@ CASE_SENSE_NAMES = NO
531531
# scope will be hidden.
532532
# The default value is: NO.
533533

534-
HIDE_SCOPE_NAMES = YES
534+
HIDE_SCOPE_NAMES = NO
535535

536536
# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
537537
# append additional text to a page's title, such as Class Reference. If set to
@@ -570,7 +570,7 @@ INLINE_INFO = YES
570570
# name. If set to NO, the members will appear in declaration order.
571571
# The default value is: YES.
572572

573-
SORT_MEMBER_DOCS = NO
573+
SORT_MEMBER_DOCS = YES
574574

575575
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
576576
# descriptions of file, namespace and class members alphabetically by member
@@ -703,7 +703,7 @@ FILE_VERSION_FILTER =
703703
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
704704
# tag is left empty.
705705

706-
LAYOUT_FILE = src/DoxygenLayout.xml
706+
LAYOUT_FILE =
707707

708708
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
709709
# the reference definitions. This must be a list of .bib files. The .bib
@@ -790,8 +790,7 @@ WARN_LOGFILE =
790790
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
791791
# Note: If this tag is empty the current directory is searched.
792792

793-
INPUT = ../include \
794-
../src/
793+
INPUT = ../include/ ./src/
795794

796795
# This tag can be used to specify the character encoding of the source files
797796
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -907,9 +906,7 @@ EXCLUDE_SYMBOLS =
907906
# that contain example code fragments that are included (see the \include
908907
# command).
909908

910-
EXAMPLE_PATH = ../examples/src/ \
911-
../library/include \
912-
../rc_project_template
909+
EXAMPLE_PATH =
913910

914911
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
915912
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -923,7 +920,7 @@ EXAMPLE_PATTERNS = *
923920
# irrespective of the value of the RECURSIVE tag.
924921
# The default value is: NO.
925922

926-
EXAMPLE_RECURSIVE = YES
923+
EXAMPLE_RECURSIVE = NO
927924

928925
# The IMAGE_PATH tag can be used to specify one or more files or directories
929926
# that contain images that are to be included in the documentation (see the
@@ -998,7 +995,7 @@ USE_MDFILE_AS_MAINPAGE =
998995
# also VERBATIM_HEADERS is set to NO.
999996
# The default value is: NO.
1000997

1001-
SOURCE_BROWSER = YES
998+
SOURCE_BROWSER = NO
1002999

10031000
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
10041001
# classes and enums directly into the documentation.
@@ -1011,7 +1008,7 @@ INLINE_SOURCES = NO
10111008
# Fortran comments will always remain visible.
10121009
# The default value is: YES.
10131010

1014-
STRIP_CODE_COMMENTS = NO
1011+
STRIP_CODE_COMMENTS = YES
10151012

10161013
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
10171014
# function all documented functions referencing it will be listed.
@@ -1491,14 +1488,14 @@ GENERATE_TREEVIEW = YES
14911488
# Minimum value: 0, maximum value: 20, default value: 4.
14921489
# This tag requires that the tag GENERATE_HTML is set to YES.
14931490

1494-
ENUM_VALUES_PER_LINE = 1
1491+
ENUM_VALUES_PER_LINE = 4
14951492

14961493
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
14971494
# to set the initial width (in pixels) of the frame in which the tree is shown.
14981495
# Minimum value: 0, maximum value: 1500, default value: 250.
14991496
# This tag requires that the tag GENERATE_HTML is set to YES.
15001497

1501-
TREEVIEW_WIDTH = 300
1498+
TREEVIEW_WIDTH = 250
15021499

15031500
# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
15041501
# external symbols imported via tag files in a separate window.
@@ -2062,7 +2059,7 @@ ENABLE_PREPROCESSING = YES
20622059
# The default value is: NO.
20632060
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
20642061

2065-
MACRO_EXPANSION = YES
2062+
MACRO_EXPANSION = NO
20662063

20672064
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
20682065
# the macro expansion is limited to the macros specified with the PREDEFINED and

docs/src/mainpage.dox

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,79 @@
11
/**
2-
32
\mainpage
3+
# Setup
4+
## Install dependencies on Beaglebone:
5+
6+
~~~
7+
$ sudo apt install libjson-c-dev libjson-c3
8+
~~~
9+
10+
## Install librobotcontrol on Beaglebone:
11+
12+
The repo for the library is located on the <a href="https://github.com/StrawsonDesign/librobotcontrol" target="_blank">Strawson Design</a> GitHub page. There is a bug in the 1.0.4 release version (rc_duplicate_filter fails for initialized filter) so <a href="http://strawsondesign.com/docs/librobotcontrol/installation.html" target="_blank">install librobotcontrol from source</a>.
13+
14+
## Transfer rc_pilot source to Beaglebone:
15+
In the scripts folder there are some convenient scripts for moving files to and from the vehicle. These scripts were build and tested on Ubuntu 19.04 but have not been tested on any other system. They should work on any system with bash and rsync. To transfer the files to the vehicle run:
16+
17+
~~~
18+
$ ./scripts/transfer_rcpilot [usb|wifi]
19+
~~~
20+
21+
## Build on Beaglebone (from project directory):
22+
23+
~~~
24+
$ make
25+
~~~
26+
27+
## Run RC_pilot:
28+
29+
~~~
30+
$ cd bin
31+
$ sudo ./rc_pilot -s ../settings/quad_settings.json
32+
~~~
33+
34+
# Miscellaneous
35+
## Building docs:
36+
37+
Make sure that doxygen is installed on your system and run
38+
39+
~~~
40+
$ make docs
41+
~~~
42+
43+
Open the docs with the web browser of your choice
44+
45+
~~~
46+
$ firefox html/index.html
47+
$ google-chrome html/index.html
48+
~~~
49+
50+
## (COMING SOON) Testing:
51+
Test cases are written using the <a href="https://www.boost.org/users/history/version_1_66_0.html" target="_blank">Boost 1.66.</a> unit test framework. Look at make target test for system install location. This suite is not written with portability in mind so you may need to tweak the build system in order to get it to compile on your machine. The boost libraries should be isntalled in /usr/local/lib and the headers should be installed in /usr/local/boost_1_66_0 (check the Makefile to confirm this).
52+
53+
Run the test suit with the make target:
54+
~~~
55+
$ make test
56+
~~~
57+
58+
### Adding Test Modules
59+
60+
To add a test modules, create a new file <module_name>_test.cpp and format it as follows:
61+
62+
~~~
63+
#include <boost/test/unit_test.hpp>
464

65+
BOOST_AUTO_TEST_SUIT(Test_<module_name>)
566

6-
This package contains the C library and example/testing programs for the Robot Control project. This project began as a hardware interface for the Robotics Cape and later the BeagleBone Blue and was originally called Robotics_Cape_Installer. It grew to include an extensive math library for discrete time feedback control, as well as a plethora of POSIX-compliant functions for timing, multithreading, program flow, and lots more. Everything is aimed at developing robotics software on embedded computers.
67+
BOOST_AUTO_TEST_CASE(test1){...}
768

8-
This package ships with official BeagleBone images and is focused on, but not excludive to, the BeagleBoard platform. The library and example programs are primarily written in C, however there also exists the RCPY python interface to this package available at <https://github.com/mcdeoliveira/rcpy>.
69+
BOOST_AUTO_TEST_CASE(test2){...}
970

10-
The master branch is always the most current but not necessarily stable. See [releases](https://github.com/StrawsonDesign/Robotics_Cape_Installer/releases) page for older stable versions or install from BeagleBoard.org repositories.
71+
...
1172

12-
To get started, visit the [user manual](manual.html)
73+
BOOST_AUTO_TEST_CASE_END()
74+
~~~
1375

76+
The make target will compile each test module into a single executable and run all test cases simultaneously.
1477

1578
*/
1679

include/feedback.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* feedback_march(void) will monitor the setpoint which is constantly being
1111
* changed by setpoint_manager(void).
1212
*
13+
* @addtogroup Feedback
14+
* @{
1315
*/
1416

1517
#ifndef FEEDBACK_H
@@ -86,3 +88,5 @@ int feedback_arm(void);
8688
int feedback_cleanup(void);
8789

8890
#endif // FEEDBACK_H
91+
92+
/**@} end group Feedback */

include/flight_mode.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/**
22
* <flight_mode.h>
3+
*
4+
* @brief Flight mode definitions
5+
*
6+
* @addtogroup FlightModes
7+
* @{
38
*/
49

510
#ifndef FLIGHT_MODE_H
@@ -70,4 +75,6 @@ typedef enum flight_mode_t
7075

7176
} flight_mode_t;
7277

73-
#endif
78+
#endif
79+
80+
/**@}end group Flight Modes */

include/input_manager.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/**
22
* <input_manager.h>
33
*
4-
* Functions to start and stop the input manager thread which is the translation
4+
* @brief Functions to start and stop the input manager thread which is the translation
55
* beween control inputs from DSM to the user_input struct which is read by the
66
* setpoint manager. TODO: Allow other inputs such as mavlink
7+
*
8+
* @addtogroup InputManager
9+
* @{
710
*/
811

912
#ifndef INPUT_MANAGER_H
@@ -75,3 +78,5 @@ int input_manager_init(void);
7578
int input_manager_cleanup(void);
7679

7780
#endif // INPUT_MANAGER_H
81+
82+
/**@}end group InputMaganger */

include/mavlink_manager.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/**
22
* <mavlink_manager.h>
33
*
4-
* Functions to start and stop the mavlink manager
4+
* @brief Functions to start and stop the mavlink manager
5+
*
6+
* @addtogroup MavlinkManager
7+
* @{
58
*/
69

710
#ifndef MAVLINK_MANAGER_H
@@ -22,3 +25,5 @@ int mavlink_manager_init(void);
2225
int mavlink_manager_cleanup(void);
2326

2427
#endif // MAVLINK_MANAGER_H
28+
29+
/* @} end group Mavlink Manager */

0 commit comments

Comments
 (0)