Revision a8480867
ID | a84808670408804bf5ce08741a3b59130351928f |
Made a lot of changes to the general structure.
Applied object-orienting techniques to the code, cleaning it up considerably. Major design changes are as follows:
- All separate node code (ie motors) are meant to only interface with hardware - doing as little logic as possible.
- Instead, the logic is moved to a class (ie MotorControl) in libscout. PID and other tools should be located here. This significantly reduces dependencies.
- Files can be included cross-package by being placed in /include/packagename, but this should be avoided to reduce dependencies.
A few formatting changes:
- Comments should end with / always, not */
- Use @ instead of \
- No double newlines.
The motors node is revamped and pretty much correct at this point.
scout/libscout/src/libscout.h | ||
---|---|---|
23 | 23 |
* OTHER DEALINGS IN THE SOFTWARE. |
24 | 24 |
**/ |
25 | 25 |
|
26 |
|
|
27 | 26 |
/** |
28 | 27 |
* @file libscout.h |
29 | 28 |
* @brief Contains top level scout library functions |
... | ... | |
41 | 40 |
#ifndef _LIBSCOUT_H_ |
42 | 41 |
#define _LIBSCOUT_H_ |
43 | 42 |
|
44 |
#include "ros/ros.h"
|
|
45 |
#include "constants.h"
|
|
46 |
#include "libmotors.h" |
|
47 |
#include "libheadlights.h"
|
|
48 |
#include "libbuttons.h"
|
|
43 |
#include <ros/ros.h>
|
|
44 |
#include <libscout/constants.h>
|
|
45 |
|
|
46 |
#include "MotorControl.h"
|
|
47 |
#include "HeadlightControl.h"
|
|
49 | 48 |
|
50 | 49 |
/* Libscout functions */ |
51 | 50 |
int init(int modules, int argc, char **argv); |
Also available in: Unified diff