-
Notifications
You must be signed in to change notification settings - Fork 4
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
Open-loop odometry #39
Open-loop odometry #39
Conversation
@@ -108,7 +108,8 @@ static bool getWheelRadius(const boost::shared_ptr<const urdf::Link>& wheel_link | |||
namespace diff_drive_controller{ | |||
|
|||
DiffDriveController::DiffDriveController() | |||
: command_struct_() | |||
: open_loop_(false) |
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.
It is better style to add new parameters at the bottom. This can help prevent ABI breaks.
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.
I tried to put it together with other odometry related attributes in the header file.
It just happened to be before command_struct_
, so I had to put it at the beginning.
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.
no problem. This is not really a library anyway, so nothing builds against this API.
Nice refactoring @bmagyar Now we use |
* \param time Current time | ||
* \return true if the odometry is actually updated | ||
*/ | ||
void update_open_loop(double linear, double angular, const ros::Duration &period); |
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.
updateOpenLoop
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.
+1
also, same as above for update()
Period is constant in every control loop execution. |
Could you provide a brief summary of the PR, to better match the code with the expectations of the PR? (and to make sure that no extra changesets made it through by mistake). Also, please mention API additions and changes. This PR changes public interfaces, but the affected classes might be internal. |
/// Current pose: | ||
double x_; // [m] | ||
double y_; // [m] | ||
double heading_; // [rad] | ||
|
||
/// Current velocity (for open loop mode): |
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.
after Bence's refactoring it's now for both open loop and closed loop
@bmagyar thanks for the refactoring, but the title of the commit is misleading, since you also changed the behavior (time -> period) |
@adolfo-rt The purpose of this PR was originally to support open loop odometry when there are no encoders.
Some refactoring was done later that basically simplifies setting the odometry message and tf with the odometry values (especially the We also changed the behaviour to use |
@adolfo-rt This PR only affects internal classes. It adds |
It also adds a rosparam, that is external API that has to be documented. |
@po1 I think the simple test I've added should be enough. |
Testing on REEM-H2. |
It works, both open and close loops. |
all good for me |
After talking with @lucamarchionni we have decided that it's better to use the |
@efernandez I'd be curious to have a short summary of the motivation for reverting to |
BTW, all (8/8) unit tests passed. |
The reason for using The init function definitely makes things better, now we won't have a big bump upon the first update. This wasn't causing problems on REEM but might do on other platforms, better be safe. |
Last changes tested on REEM-H2 robot. @po1 I've followed @lucamarchionni recommendation to use the @bmagyar @adolfo-rt If you find it right now, I'll merge it. |
I'd squash the 2 commits about cosmetics, and rebase the rest, but the contents are fine. |
+1 |
Cosmetic changes squashed into one. I don't feel like merging my own PR... |
@bmagyar @efernandez IIRC that was exactly the motivation to use @efernandez I suggest you give a try to both options, especially on a system that has a very low resolution odometry, if you see what I refer to. In the mean time, let's merge this and open more PRs if needed. |
@bmagyar in the future, please don't label a commit as 'cosmetic' if it contains changes in the API (even internal) and the logic. |
The purpose of this PR is to support open loop odometry when there are no encoders.
It basically adds:
Odometry
class to update using the last linear and angular velocities received by the controller, i.e. set the odometry twist directly with then and integrate the position (x, y)