-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PID Control of lateral error #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good, some minor comments
@@ -188,6 +202,8 @@ MoveBasic::MoveBasic(): tfBuffer(ros::Duration(30.0)), | |||
|
|||
obstacle_dist_pub = | |||
ros::Publisher(nh.advertise<std_msgs::Float32>("/obstacle_distance", 1)); | |||
errorPub = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Vector3 make sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector3 makes sense for the error, since there is no Vector2. However, adding the commanded rotation in there is bogus, and that information is available from /cmd_vel, so I'll remove it.
src/move_basic.cpp
Outdated
(lateralKd * lateralDiff); | ||
|
||
// Limit rotation | ||
if (rotation > lateralMaxRotation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::min/std::max for clamping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what we used in other places in the file, so I'll change it.
ROS_WARN("Cannot determine robot pose for linear"); | ||
continue; | ||
} | ||
|
||
tf2::Vector3 travelled = poseOdomInitial.getOrigin() - poseOdom.getOrigin(); | ||
double distTravelled = travelled.length();; | ||
tf2::Transform goalInBase = poseOdom * goalInOdom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@rohbotics Thanks for the review. Ready for rereview, thanks. |
Adds PID control to rotation to keep linear movement on its intended path.