Revision 2237e1f0
ID | 2237e1f0a505e07f01a4d3d3bfa818fba34e9386 |
Changed motor max speed and added constants in set_motors.msg
The new speed range is -100 to 100, to be consistent with the pwm
driver. They can be accessed with motors::set_motors::MIN_SPEED and
motors::set_motors::MAX_SPEED respectively.
scout/motors/msg/set_motors.msg | ||
---|---|---|
5 | 5 |
bool br_set |
6 | 6 |
bool teleop_ON |
7 | 7 |
|
8 |
# The absolute motor speeds to set (-128 to 127) |
|
9 |
# TODO check that this is the correct range |
|
8 |
# The absolute motor speeds to set |
|
10 | 9 |
int8 fl_speed |
11 | 10 |
int8 fr_speed |
12 | 11 |
int8 bl_speed |
13 | 12 |
int8 br_speed |
13 |
|
|
14 |
int8 MAX_SPEED = 100 |
|
15 |
int8 MIN_SPEED = -100 |
scout/scoutsim/src/scout_constants.h | ||
---|---|---|
48 | 48 |
#ifndef _SCOUTSIM_SCOUT_CONSTANTS_ |
49 | 49 |
#define _SCOUTSIM_SCOUT_CONSTANTS_ |
50 | 50 |
|
51 |
#include <motors/set_motors.h> |
|
52 |
|
|
51 | 53 |
/// TODO put these in a utility file somewhere? |
52 | 54 |
#define min(x,y) ((x < y) ? x : y) |
53 | 55 |
#define max(x,y) ((x > y) ? x : y) |
... | ... | |
55 | 57 |
namespace scoutsim |
56 | 58 |
{ |
57 | 59 |
// Maximum speed which will be sent to scoutsim in absolute units |
58 |
const int MAX_ABSOLUTE_SPEED = 127;
|
|
59 |
const int MIN_ABSOLUTE_SPEED = -128;
|
|
60 |
const int MAX_ABSOLUTE_SPEED = motors::set_motors::MAX_SPEED;
|
|
61 |
const int MIN_ABSOLUTE_SPEED = motors::set_motors::MIN_SPEED;
|
|
60 | 62 |
|
61 | 63 |
// Speed in m/s corresponding to maximum absolute speed |
62 | 64 |
const float MAX_SPEED_MPS = 1.0; |
scout/scoutsim/src/sim_frame.h | ||
---|---|---|
80 | 80 |
#define ID_TELEOP_PRECISE 8 |
81 | 81 |
#define ID_TELEOP_FLUID 9 |
82 | 82 |
|
83 |
// Absolute speeds (-128 - 127)
|
|
83 |
// Absolute speeds (-100 - 100)
|
|
84 | 84 |
/// @todo: Clean this up a little; we should be risking overflowing shorts. |
85 |
#define TELEOP_PRECISE_SPEED 60
|
|
86 |
#define TELEOP_PRECISE_TURN_SPEED 124
|
|
87 |
#define TELEOP_FLUID_MAX_SPEED 100
|
|
88 |
#define TELEOP_FLUID_INC 8
|
|
85 |
#define TELEOP_PRECISE_SPEED 47
|
|
86 |
#define TELEOP_PRECISE_TURN_SPEED 98
|
|
87 |
#define TELEOP_FLUID_MAX_SPEED 79
|
|
88 |
#define TELEOP_FLUID_INC 6
|
|
89 | 89 |
|
90 | 90 |
// Teleop types |
91 | 91 |
#define TELEOP_OFF 0 |
Also available in: Unified diff