From 88f1c7071d15f867244c1bb31d3766e657c0a5c1 Mon Sep 17 00:00:00 2001 From: schodet Date: Wed, 19 Apr 2006 07:28:20 +0000 Subject: Début de simulation de positionnement. --- n/asserv/src/asserv/models.host.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'n/asserv/src/asserv/models.host.c') diff --git a/n/asserv/src/asserv/models.host.c b/n/asserv/src/asserv/models.host.c index 062b88a..15e7259 100644 --- a/n/asserv/src/asserv/models.host.c +++ b/n/asserv/src/asserv/models.host.c @@ -42,6 +42,8 @@ static const struct motor_t gloubi_model = 0.75, /* Gearbox efficiency. */ /* Load caracteristics. */ 4 * 0.02 * 0.02, /* Load (kg.m^2). */ + /* Wheel caracteristics. */ + 0.02, /* Wheel radius (m). */ /* Simulation parameters. */ 4.444444 / 1000, /* Simulation time step (s). */ 1000, /* Simulation time step division. */ @@ -53,6 +55,12 @@ static const struct motor_t gloubi_model = 0 /* Current theta (th for theta) (rad). */ }; +static const struct robot_t gloubi_robot = +{ + gloubi_model, + 26.0, /* Distance between the wheels (m). */ +}; + /* Taz model. */ static const struct motor_t taz_model = { @@ -67,6 +75,8 @@ static const struct motor_t taz_model = 0.75, /* Gearbox efficiency. */ /* Load caracteristics. */ 10 * 0.04 * 0.04, /* Load (kg.m^2). */ + /* Wheel caracteristics. */ + 0.04, /* Wheel radius (m). */ /* Simulation parameters. */ 4.444444 / 1000, /* Simulation time step (s). */ 1000, /* Simulation time step division. */ @@ -78,6 +88,12 @@ static const struct motor_t taz_model = 0 /* Current theta (th for theta) (rad). */ }; +static const struct robot_t taz_robot = +{ + taz_model, + 30.0, /* Distance between the wheels (m). */ +}; + /* Taz model, with a RE25G and a 1:20.25 ratio gearbox. */ static const struct motor_t tazg_model = { @@ -92,6 +108,8 @@ static const struct motor_t tazg_model = 0.75, /* Gearbox efficiency. */ /* Load caracteristics. */ 10 * 0.04 * 0.04, /* Load (kg.m^2). */ + /* Wheel caracteristics. */ + 0.04, /* Wheel radius (m). */ /* Simulation parameters. */ 4.444444 / 1000, /* Simulation time step (s). */ 1000, /* Simulation time step division. */ @@ -103,27 +121,33 @@ static const struct motor_t tazg_model = 0 /* Current theta (th for theta) (rad). */ }; +static const struct robot_t tazg_robot = +{ + tazg_model, + 30.0, /* Distance between the wheels (m). */ +}; + /* Table of models. */ static const struct { const char *name; - const struct motor_t *model; + const struct robot_t *robot; } models[] = { - { "gloubi", &gloubi_model }, - { "taz", &taz_model }, - { "tazg", &tazg_model }, + { "gloubi", &gloubi_robot }, + { "taz", &taz_robot }, + { "tazg", &tazg_robot }, { 0, 0 } }; /** Get a pointer to a model by name, or return 0. */ -const struct motor_t * +const struct robot_t * models_get (const char *name) { int i; for (i = 0; models[i].name; i++) { if (strcmp (models[i].name, name) == 0) - return models[i].model; + return models[i].robot; } return 0; } -- cgit v1.2.3