Project

General

Profile

Revision a8480867

IDa84808670408804bf5ce08741a3b59130351928f

Added by Alex Zirbel over 12 years ago

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.

View differences:

scout/motors/msg/set_motors.msg
1 1
Header header
2 2

  
3
# Keeps track of which motors need to be changed
4
int8 which
5

  
6 3
# Set these to true if the motor should be updated
7 4
bool fl_set
8 5
bool fr_set
9 6
bool bl_set
10 7
bool br_set
11 8

  
12
# The motor speeds, from -255 to 255 if absolute
13
# -100 to 100 if percentage
14
# Decimal values if in measured units
15
float32 fl_speed
16
float32 fr_speed
17
float32 bl_speed
18
float32 br_speed
19

  
20
# Allows motor speeds to be specified mm/s, cm/s, percent, or absolute
21
int8 units
9
# The absolute motor speeds to set
10
int8 fl_speed
11
int8 fr_speed
12
int8 bl_speed
13
int8 br_speed

Also available in: Unified diff