From: Xavier L. <Ba...@us...> - 2011-04-25 21:12:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via fa8932bc991c708686e7813f52e5d441c1f3b966 (commit) via 4bd527c9a4d54185ac2a373c956a57a74c281350 (commit) from b18032438c48e011c678a04eb968c697bb90e66c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fa8932bc991c708686e7813f52e5d441c1f3b966 Author: Xavier Lagorce <Xav...@cr...> Date: Mon Apr 25 23:11:01 2011 +0200 [Controller_Motor_STM32] Fixed ghost angle conversion. commit 4bd527c9a4d54185ac2a373c956a57a74c281350 Author: Xavier Lagorce <Xav...@cr...> Date: Mon Apr 25 22:40:10 2011 +0200 [Controller_Motor_STM32] Added possibilty for backward movement. ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_messages.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_messages.h index 5760216..81a44c2 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_messages.h +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_messages.h @@ -90,9 +90,9 @@ typedef struct { typedef struct { uint16_t x_end:12 __attribute__((__packed__)); // end point x coordinate in mm uint16_t y_end:12 __attribute__((__packed__)); // end point y coordinate in mm - uint8_t d1; // first branch length in cm - uint8_t d2; // last branch length in cm - int16_t theta_end:13 __attribute__((__packed__)); // end angle in 1/1000 radians + int16_t d1:9 __attribute__((__packed__)); // first branch length in cm + uint8_t d2:8 __attribute__((__packed__)); // last branch length in cm + int16_t theta_end:12 __attribute__((__packed__)); // end angle in 1/100 radians uint16_t v_end:11 __attribute__((__packed__)); // final speed in mm/s } bezier_msg_t; diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c index 22fa8c1..8c3793d 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c @@ -121,7 +121,7 @@ static void NORETURN canMonitor_process(void) { msg_ghost.data.state = dd_get_ghost_state(&odometry, &u); msg_ghost.data.x = (int16_t)(odometry.x * 1000.0); msg_ghost.data.y = (int16_t)(odometry.y * 1000.0); - msg_ghost.data.theta = (int16_t)(odometry.theta * 1000.0); + msg_ghost.data.theta = (int16_t)(odometry.theta * 10000.0); msg_ghost.data.u = (uint8_t)(u * 255); txm.data32[0] = msg_ghost.data32[0]; txm.data32[1] = msg_ghost.data32[1]; @@ -188,7 +188,7 @@ static void NORETURN canMonitorListen_process(void) { bezier_msg.data32[1] = frame.data32[1]; dd_add_bezier(bezier_msg.data.x_end/1000.0, bezier_msg.data.y_end/1000.0, bezier_msg.data.d1/100.0, bezier_msg.data.d2/100.0, - bezier_msg.data.theta_end/1000.0, bezier_msg.data.v_end/1000.0); + bezier_msg.data.theta_end/100.0, bezier_msg.data.v_end/1000.0); break; case CAN_MSG_STOP: stop_msg.data32[0] = frame.data32[0]; diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c index 7883f9a..179db7f 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c @@ -326,7 +326,7 @@ uint8_t dd_add_bezier(float x_end, float y_end, float d1, float d2, float end_an traj->theta_end = end_angle; traj->start[0] = x_ini; traj->start[1] = y_ini; - traj->theta_ini = theta_ini; + traj->theta_ini = (d1 >= 0.0) ? theta_ini : (theta_ini + M_PI); // Differentiate parameters bezier_diff(traj->params, traj->dparams); bezier_diff(traj->dparams, traj->ddparams); hooks/post-receive -- krobot |