Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gxiang
Mobilebot
Commits
aaf6fab6
Commit
aaf6fab6
authored
Sep 19, 2021
by
jxchenlu
Browse files
merge odom complete
parent
7ed0e320
Changes
3
Hide whitespace changes
Inline
Side-by-side
common/mb_defs.h
View file @
aaf6fab6
...
...
@@ -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)
...
...
common/mb_odometry.c
View file @
aaf6fab6
...
...
@@ -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
}
...
...
mobilebot/mobilebot.c
View file @
aaf6fab6
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment