-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[WIP] Improve testability to explore velocity command generation for an Ackermann Steered Polaris #4218
[WIP] Improve testability to explore velocity command generation for an Ackermann Steered Polaris #4218
Conversation
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
1 similar comment
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
7203c47
to
eb490d1
Compare
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
Here is a sample of the velocity_test parameter sweep report. I am forcing angular velocity z feedback to 0. Its getting higher speeds. AT LAST. Just going full speed backward. Could be the dummy path I am feeding it is behind the vehicle.
|
@aosmw I'd suggest closing this PR until you have something ready for review or have any particular questions that need address. Changing the defaults in Nav2 Bringup for all users is not a contribution which we'd accept. Its also hard for me to tell what changes you made considering you're including another unrelated branch in this PR. If nothing else, you definitely need to remove that / rebase on |
The unrelated commits in this PR is the result of me living on the bleeding edge of your mppi_opt branch while I figured out the code base. I will rebase it back on main now that you have merged your mppi_opt branch. The parameter changes above are isolated to the internals of a new nav2_mppi_controller/test/velocity_test.cpp. The test factories remain as default. The ultimate point of the changes were to be able to run loops over optimizer->evalControl(); while changing parameters and having optimiser->reset() actually reset all its internal state, and have the critics actually take on new values. I will contribute some separate bug fix PRs for the internal state resetting and some changes to the test factories to allow parameters to be changed between calls to optimiser->reset(). I fell back to this low level of isolated testing because I could not understand the reasons for why our robot was not getting commands to drive at its vx_max when the path to its goal was straight ahead. Even when the only critics activated are the PathFollowCritic and PreferForwardCritic. (Yes we have a big offroad test area/field and multiple independent emergency stop systems.) I also fell back to this low level test to isolate from noisy sensors, noisy localisation, rough terrain and purely concentrate on what values the controller was coming up with. I would love a comment on the following. Is the following correct thinking about parameter selection? SCENARIOThe time taken to manually drive a full circle at a reasonable speed(comfortable and safe) with the steering wheel at full lock is ~12 seconds. This equates to a linear distance of HYPOTHESISwz_max should be 0.52 A smaller than default wx_std(0.4) is more appropriate for a larger(than a turtlebot) Ackermann steered vehicle(2.75m turning radius). BECAUSEThe trajectories generated by a large wx_std have a larger proportion of larger steering angles. Trajectories with larger steering angles lead to control predictions that if applied(integrated) at higher speeds, would see an Ackermann vehicle steer off course at a higher rate. The critics don't score these higher speeds with higher steering inputs favourably. Therefore lower linear speeds end up being favoured. CONCLUSIONvx_max may not be reached in an Ackerman steered vehicle as it is coupled/affected by wx_max and wz_std. An Ackermann Steered vehicle's angular velocity is coupled to its linear velocity. mppi noise parameter selection needs to take account of this coupling. To get higher cmd_vel.twist.linear.x control outputs, more predictions of smaller steering inputs need to be scored by the critics. QUESTIONIs this coupling between vx_max and wx_std a fact of life? |
Signed-off-by: Mike Wake <[email protected]>
This allows the velocity_test report file to be saved next to the test executable Signed-off-by: Mike Wake <[email protected]>
- reorder ParametersHandler::start() to avoid warning about dynamic verbose parameter - improve log messages when in verbose Signed-off-by: Mike Wake <[email protected]>
separate controller params from optimiser with view to allow test control over controller_frequency Signed-off-by: Mike Wake <[email protected]>
Signed-off-by: Mike Wake <[email protected]>
…imal_trajectory This allows for a happier medium of visualising the optimal trajectory chose without the load/cost of visualising all generated trajectories
To explore parameter space with tests allow variation of more optimiser and costmap parameters. Signed-off-by: Mike Wake <[email protected]>
Signed-off-by: Mike Wake <[email protected]>
Signed-off-by: Mike Wake <[email protected]>
* state.reset() now also resets pose and speed and its xtensors * iterate over control_history_ and call reset() * use xt::noalias() when zeroing in reset() funcs to actually assign zero and clean out old state. "Assigning to a container or a view after it has been initialized involves a temporary to avoid aliasing." See xtensor-stack/xtensor#702 (comment) Signed-off-by: Mike Wake <[email protected]>
Signed-off-by: Mike Wake <[email protected]>
Signed-off-by: Mike Wake <[email protected]>
* Purpose interate through interesting parameters/velocities and log reponses of optimizer->evalControls() to csv file for analysis. * Path in straight line in x dir only. * Control feedback func has direct feedback and ignores z to experiment with exposing coupling effect of wz_std on vx_max * Reproducible with noise_seed parameter Signed-off-by: Mike Wake <[email protected]>
c2afa30
to
9626b72
Compare
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
Ah ok, a few changes I didn't immediately ack as my own. I knew some where, but sometimes how your brain pattern matches is context sensitive 😆 There is definitely a coupling of the ackermann constraint - to save you some time, its computed here: https://github.com/ros-planning/navigation2/blob/main/nav2_mppi_controller/include/nav2_mppi_controller/motion_models.hpp#L125-L126. In it, we set the angular velocity to be scaled back so that we meet the turning radius constraint for the given translational velocity. Though, it is just as valid to consider the opposite case where we reduce the -- On your chart, I suppose it doesn't surprise me that if you have higher speeds, higher std values might be valuable to have quicker responses on acceleration since it can effectively search more of the parameter space for the critics to evaluate. Your wz seems low at It doesn't grokk with me immediately that having a lower std would intrinsically result in a lower velocity cap. I would just expect that it would take more iterations to explore the parameter space fully to get up to speed (i.e. so running faster would help). I'm thinking that the critics that are being evaluated in this situation have a local minima that these are settled in instead. I'd be curious if you ran that again with the speed starting high if for those situations that it approaches the non-max-speed limit, if it goes back down to those values or keeps at the max speed to understand if it is a local minima or a global minima to go at that speed. Do you see this same behavior for the differential drive motion model? That can also help us identify if this is unique to the ackermann introduced constraint or a system behavior |
@aosmw, your PR has failed to build. Please check CI outputs and resolve issues. |
Closing due to lack of reponses |
Basic Info
Description of contribution in a few bullet points
Improve testability/reset-ability of nav2_mppi_controller state and create a velocity test to help explore parameters and attempt to build intuition around how max velocity is reached.
Added and documented the following new parameters
dump_noise - dump noise to file for inpection
noise_seed - control noise generation with a seed for reproducability
visualize_generated_trajectories - visualise ALL generated trajectories
visualize_optimal_trajectory - visualise just the optimal trajectory
The last few commits of this PR are me trying to explore the problem space and are not intended to be merged in their current form.
Description of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: