Commit aaf6fab6 authored by jxchenlu's avatar jxchenlu
Browse files

merge odom complete

parent 7ed0e320
......@@ -23,17 +23,10 @@
#define LEFT_ENC_POL 1
#define RIGHT_ENC_POL -1
// TODO: Fill in physical propeties of robot
<<<<<<< HEAD
#define GEAR_RATIO 78.0 // gear ratio of motor
#define ENCODER_RES 20.0 // encoder counts per motor shaft revolution
#define WHEEL_DIAMETER 0.084 // diameter of wheel in meters
#define WHEEL_BASE 0.158 // wheel separation distance in meters
=======
#define GEAR_RATIO 78 // gear ratio of motor
#define ENCODER_RES 20 // encoder counts per motor shaft revolution
#define WHEEL_DIAMETER 0.08 // diameter of wheel in meters
#define WHEEL_BASE 0.0 // wheel separation distance in meters
>>>>>>> withlivecode
#define MAX_FWD_VEL 0.8 // maximum forwad speed (m/s)
#define MAX_TURN_VEL 2.5 // maximum turning speed (rad/s)
......
......@@ -19,13 +19,9 @@
*
*******************************************************************************/
void mb_initialize_odometry(mb_odometry_t* mb_odometry, float x, float y, float theta){
<<<<<<< HEAD
mb_odometry->x = x;
mb_odometry->y = y;
mb_odometry->theta = theta;
=======
>>>>>>> origin/withlivecode
}
......
......@@ -168,12 +168,9 @@ void read_mb_sensors(){
void publish_mb_msgs(){
mbot_imu_t imu_msg;
mbot_encoder_t encoder_msg;
<<<<<<< HEAD
odometry_t odo_msg;
=======
mbot_wheel_ctrl_t wheel_ctrl_msg;
// odometry_t odo_msg;
>>>>>>> origin/withlivecode
//Create IMU LCM Message
imu_msg.utime = now;
......@@ -210,12 +207,9 @@ void publish_mb_msgs(){
//publish IMU & Encoder Data to LCM
mbot_imu_t_publish(lcm, MBOT_IMU_CHANNEL, &imu_msg);
mbot_encoder_t_publish(lcm, MBOT_ENCODER_CHANNEL, &encoder_msg);
<<<<<<< HEAD
odometry_t_publish(lcm, ODOMETRY_CHANNEL, &odo_msg);
=======
mbot_wheel_ctrl_t_publish(lcm,"MBOT_WHEEL_CTRL",&wheel_ctrl_msg);
// odometry_t_publish(lcm, ODOMETRY_CHANNEL, &odo_msg);
>>>>>>> origin/withlivecode
}
/*******************************************************************************
......@@ -234,13 +228,10 @@ void publish_mb_msgs(){
void mobilebot_controller(){
update_now();
read_mb_sensors();
<<<<<<< HEAD
// calculate odometry after update reading and defining sensors readings during each call-back
// mb_odometry x,y,theta will be updated in mb_odoemtry.c
mb_update_odometry(&mb_odometry, &mb_state) ;
=======
mb_controller_update(&mb_state,&mb_setpoints);
>>>>>>> origin/withlivecode
publish_mb_msgs();
rc_motor_set(LEFT_MOTOR,LEFT_MOTOR_POL*mb_state.left_cmd);
rc_motor_set(RIGHT_MOTOR,RIGHT_MOTOR_POL*mb_state.right_cmd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment