Skip to content

Commit

Permalink
Adding get angle, code isn't finished. need to. finish get_angle. imp…
Browse files Browse the repository at this point in the history
…lement get_encoder_angle, and odom one too. Also need to figure out how to set priority. After meeting with Jess, will fine tune and review design choices.
  • Loading branch information
HakopZ committed Jan 6, 2025
1 parent a4dc9a7 commit d7ff6f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,12 @@ class Drive {
* Get angle of the robot, depending on focused sensor
*/
double get_angle();

/**
* Get angle with encoder
*/
double get_encoder_angle();

/**
* Practice mode for driver practice that shuts off the drive if you go max speed.
*
Expand Down
17 changes: 16 additions & 1 deletion src/EZ-Template/drive/drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,22 @@ void Drive::drive_defaults_set() {

double Drive::get_angle()
{
return 0;
/*if there is a good imu*/
if(imu != nullptr) return drive_imu_get();

//this is odom tracking
if(is_tracker == ODOM_TRACKER) /**/;

//if width set, use ime
if(drive_width_get() != 0.0) /**/;
//

return INT_MAX;
}

double Drive::get_encoder_angle()
{
//calcualte encoder angle
}
double Drive::drive_tick_per_inch() {
if (is_tracker == ODOM_TRACKER)
Expand Down

0 comments on commit d7ff6f9

Please sign in to comment.