From 67ef08749924e759a04834d27cee40ec6e0a1854 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 16 Mar 2008 18:36:49 +0100 Subject: * digital/asserv/src/asserv: - added AMAX32GHP model. - fixed missing voltage multiplication. - added support for separated encoders. - model reorganisation. - fixed counters drift. --- digital/asserv/src/asserv/models.host.h | 34 ++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'digital/asserv/src/asserv/models.host.h') diff --git a/digital/asserv/src/asserv/models.host.h b/digital/asserv/src/asserv/models.host.h index a63a2776..36099e64 100644 --- a/digital/asserv/src/asserv/models.host.h +++ b/digital/asserv/src/asserv/models.host.h @@ -25,15 +25,43 @@ * * }}} */ +#define ECHANT_PERIOD (1.0 / (14745600.0 / 256 / 256)) + +/** Define a robot and its peripherals. + * Encoder characteristics are defined at gearbox output. */ struct robot_t { - const struct motor_t *motor; - const struct motor_t *aux0; - double footing; /* Distance between the wheels (m). */ + /** Main motors. */ + const struct motor_def_t *main_motor; + /** Number of steps on the main motors encoders. */ + int main_encoder_steps; + /** Wheel radius (m). */ + double wheel_r; + /** Distance between the wheels (m). */ + double footing; + /** Weight of the robot (kg). */ + double weight; + /** Distance of the gravity center from the center of motors axis (m). */ + double gravity_center_distance; + /** Whether the encoder is mounted on the main motor (false) or not (true). */ + int encoder_separated; + /** Encoder wheel radius (m). */ + double encoder_wheel_r; + /** Distance between the encoders wheels (m). */ + double encoder_footing; + /** First auxiliary motor or NULL if none. */ + const struct motor_def_t *aux0_motor; + /** Number of steps on the first auxiliary motor encoder. */ + int aux0_encoder_steps; }; /** Get a pointer to a model by name, or return 0. */ const struct robot_t * models_get (const char *name); +/** Initialise simulation models. */ +void +models_init (const struct robot_t *robot, struct motor_t *main_motor_left, + struct motor_t *main_motor_right, struct motor_t *aux0_motor); + #endif /* models_host_h */ -- cgit v1.2.3