Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

Commit

Permalink
Updated odom calculator accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
prajankya committed Jan 26, 2017
1 parent 1956397 commit f77286e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions agri_mapper_base/src/odom_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void odomCallback(const std_msgs::String::ConstPtr & msg) {
in[i++] = token;
}

enL = round(string_to_double(in[0]));
enR = round(string_to_double(in[1]));
enL = -round(string_to_double(in[0]));
enR = -round(string_to_double(in[1]));

//ROS_INFO_STREAM("Left:" << enL << "\tRight:" << enR);

Expand Down Expand Up @@ -102,8 +102,6 @@ void odomCallback(const std_msgs::String::ConstPtr & msg) {
th = th + (2 * PI);
}

//TODO: remove sudden change in x or y, like near to 0.5 meters, in change of 3degress

// ROS_INFO_STREAM("x:" << x << "\ty:" << y << "\ttheta:" << ((th * 180) / PI));

// ROS_INFO_STREAM("theta:" << ((th * 180) / PI));
Expand Down Expand Up @@ -155,7 +153,7 @@ void algorithm2(double dl, double dr, double dt) {
//http://rossum.sourceforge.net/papers/DiffSteer/
double s_ = (dl + dr) / 2;

dth = (dr - dl) / (wheelDistance * 2);
dth = (dl - dr) / (wheelDistance);
dx = s_ * cos(th + dth);//th+dth because th+=dth is to be done after this function is executed
dy = s_ * sin(th + dth);
}
Expand Down

1 comment on commit f77286e

@prajankya
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closed #8

Please sign in to comment.