Skip to content

Commit

Permalink
Added some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaggin committed Aug 20, 2019
1 parent 9b64c00 commit 61562b4
Show file tree
Hide file tree
Showing 18 changed files with 263 additions and 70 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ debug:
$(MAKE) $(MAKEFILE) DEBUGFLAG="-g -D DEBUG"
@echo "$(TARGET) Make Debug Complete"

docs:
@cd docs; doxygen Doxyfile

install:
@$(INSTALLDIR) $(DESTDIR)$(prefix)/bin
@$(INSTALL) $(TARGET) $(DESTDIR)$(prefix)/bin
Expand All @@ -66,3 +69,4 @@ runonboot:
@$(LINK) $(DESTDIR)$(prefix)/bin/$(TARGET) $(LINKDIR)/$(LINKNAME)
@echo "$(TARGET) Set to Run on Boot"

.PHONY: all debug docs clean install uninstall runonboot
82 changes: 73 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,78 @@
Multirotor Flight Controller for the Robotics Cape
# Documentation
[Documentation for rc_pilot](http://www-personal.umich.edu/~ghaggin/rc_pilot/)

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

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

## Install librobotcontrol on Beaglebone:

Note: depends on libjson-c-dev & libjson-c3
sudo apt install libjson-c-dev libjson-c3
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).

also libroboticscape >v0.4.0

## Transfer rc_pilot source to Beaglebone:
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:

```shell
$ ./scripts/transfer_rcpilot [usb|wifi]
```

## Build on Beaglebone (from project directory):

```shell
$ make
```

## Run RC_pilot:

```shell
$ cd bin
$ sudo ./rc_pilot -s ../settings/quad_settings.json
```

# Miscellaneous
## Building docs:

Make sure that doxygen is installed on your system and run

``` shell
$ make docs
```

Open the docs with the web browser of your choice

```shell
$ firefox docs/html/index.html
$ google-chrome docs/html/index.html
```

## (COMING SOON) Testing:
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.

Run the test suit with the make target:
```shell
$ make test
```

### Adding Test Modules

To add a test modules, create a new file <module_name>_test.cpp and format it as follows:

```c++
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUIT(Test_<module_name>)

BOOST_AUTO_TEST_CASE(test1){...}

BOOST_AUTO_TEST_CASE(test2){...}

...

BOOST_AUTO_TEST_CASE_END()
```
The make target will compile each test module into a single executable and run all test cases simultaneously.
29 changes: 13 additions & 16 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.

STRIP_FROM_INC_PATH = ../library/include/
STRIP_FROM_INC_PATH = ../include

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

TAB_SIZE = 8
TAB_SIZE = 4

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

HIDE_SCOPE_NAMES = YES
HIDE_SCOPE_NAMES = NO

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

SORT_MEMBER_DOCS = NO
SORT_MEMBER_DOCS = YES

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

LAYOUT_FILE = src/DoxygenLayout.xml
LAYOUT_FILE =

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

INPUT = ../include \
../src/
INPUT = ../include/ ./src/

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

EXAMPLE_PATH = ../examples/src/ \
../library/include \
../rc_project_template
EXAMPLE_PATH =

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

EXAMPLE_RECURSIVE = YES
EXAMPLE_RECURSIVE = NO

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

SOURCE_BROWSER = YES
SOURCE_BROWSER = NO

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

STRIP_CODE_COMMENTS = NO
STRIP_CODE_COMMENTS = YES

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

ENUM_VALUES_PER_LINE = 1
ENUM_VALUES_PER_LINE = 4

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

TREEVIEW_WIDTH = 300
TREEVIEW_WIDTH = 250

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

MACRO_EXPANSION = YES
MACRO_EXPANSION = NO

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
Expand Down
73 changes: 68 additions & 5 deletions docs/src/mainpage.dox
Original file line number Diff line number Diff line change
@@ -1,16 +1,79 @@
/**

\mainpage
# Setup
## Install dependencies on Beaglebone:

~~~
$ sudo apt install libjson-c-dev libjson-c3
~~~

## Install librobotcontrol on Beaglebone:

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>.

## Transfer rc_pilot source to Beaglebone:
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:

~~~
$ ./scripts/transfer_rcpilot [usb|wifi]
~~~

## Build on Beaglebone (from project directory):

~~~
$ make
~~~

## Run RC_pilot:

~~~
$ cd bin
$ sudo ./rc_pilot -s ../settings/quad_settings.json
~~~

# Miscellaneous
## Building docs:

Make sure that doxygen is installed on your system and run

~~~
$ make docs
~~~

Open the docs with the web browser of your choice

~~~
$ firefox html/index.html
$ google-chrome html/index.html
~~~

## (COMING SOON) Testing:
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).

Run the test suit with the make target:
~~~
$ make test
~~~

### Adding Test Modules

To add a test modules, create a new file <module_name>_test.cpp and format it as follows:

~~~
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUIT(Test_<module_name>)

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.
BOOST_AUTO_TEST_CASE(test1){...}

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>.
BOOST_AUTO_TEST_CASE(test2){...}

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.
...

To get started, visit the [user manual](manual.html)
BOOST_AUTO_TEST_CASE_END()
~~~

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

*/

Expand Down
4 changes: 4 additions & 0 deletions include/feedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* feedback_march(void) will monitor the setpoint which is constantly being
* changed by setpoint_manager(void).
*
* @addtogroup Feedback
* @{
*/

#ifndef FEEDBACK_H
Expand Down Expand Up @@ -86,3 +88,5 @@ int feedback_arm(void);
int feedback_cleanup(void);

#endif // FEEDBACK_H

/**@} end group Feedback */
9 changes: 8 additions & 1 deletion include/flight_mode.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/**
* <flight_mode.h>
*
* @brief Flight mode definitions
*
* @addtogroup FlightModes
* @{
*/

#ifndef FLIGHT_MODE_H
Expand Down Expand Up @@ -70,4 +75,6 @@ typedef enum flight_mode_t

} flight_mode_t;

#endif
#endif

/**@}end group Flight Modes */
7 changes: 6 additions & 1 deletion include/input_manager.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* <input_manager.h>
*
* Functions to start and stop the input manager thread which is the translation
* @brief Functions to start and stop the input manager thread which is the translation
* beween control inputs from DSM to the user_input struct which is read by the
* setpoint manager. TODO: Allow other inputs such as mavlink
*
* @addtogroup InputManager
* @{
*/

#ifndef INPUT_MANAGER_H
Expand Down Expand Up @@ -75,3 +78,5 @@ int input_manager_init(void);
int input_manager_cleanup(void);

#endif // INPUT_MANAGER_H

/**@}end group InputMaganger */
7 changes: 6 additions & 1 deletion include/mavlink_manager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/**
* <mavlink_manager.h>
*
* Functions to start and stop the mavlink manager
* @brief Functions to start and stop the mavlink manager
*
* @addtogroup MavlinkManager
* @{
*/

#ifndef MAVLINK_MANAGER_H
Expand All @@ -22,3 +25,5 @@ int mavlink_manager_init(void);
int mavlink_manager_cleanup(void);

#endif // MAVLINK_MANAGER_H

/* @} end group Mavlink Manager */
Loading

0 comments on commit 61562b4

Please sign in to comment.