Skip to content
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

Merged
merged 8 commits into from
Feb 23, 2019
Merged

PID Control of lateral error #45

merged 8 commits into from
Feb 23, 2019

Conversation

jim-v
Copy link
Contributor

@jim-v jim-v commented Feb 22, 2019

Adds PID control to rotation to keep linear movement on its intended path.

Copy link
Member

@rohbotics rohbotics left a 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 =
Copy link
Member

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?

Copy link
Contributor Author

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.

(lateralKd * lateralDiff);

// Limit rotation
if (rotation > lateralMaxRotation) {
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

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

👍

@jim-v
Copy link
Contributor Author

jim-v commented Feb 23, 2019

@rohbotics Thanks for the review. Ready for rereview, thanks.

@jim-v jim-v merged commit 866ba27 into kinetic-devel Feb 23, 2019
@ghost ghost removed the in review label Feb 23, 2019
@jim-v jim-v deleted the enhancements branch February 23, 2019 04:38
@rohbotics rohbotics moved this from Done to Review/Test in UbiquityRobotics/ubiquity_main Mar 25, 2019
@rohbotics rohbotics moved this from Review/Test to Done in UbiquityRobotics/ubiquity_main Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants