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

Support nonholonomic movement for slotcar #33

Merged
merged 17 commits into from
Aug 17, 2021
Merged

Conversation

ddengster
Copy link
Contributor

@ddengster ddengster commented Aug 10, 2021

New feature implementation

Implemented feature

Support nonholonomic movement for slotcar

Implementation description

Robots using the slotcar plugin can now attempt to follow a path made by nonholonomic robots via publishing to /ackmann_path_requests and adding the tag <holonomic>0</holonomic> to their sdf model files. An example script and level can be used to test in this PR open-rmf/rmf_demos#70.

Currently the nonholonomic movement update code does not consider

  • battery usage (not needed yet)
  • turning accelerations (due to bugs with the rate of change code)

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
…cleanup

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
attempted fix on turning for straight line ackmann paths
more cleanup

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
@codecov
Copy link

codecov bot commented Aug 10, 2021

Codecov Report

Merging #33 (b0926bf) into main (0455e7a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##            main     #33      +/-   ##
========================================
  Coverage   0.00%   0.00%              
========================================
  Files        222      94     -128     
  Lines      18659    8066   -10593     
========================================
+ Misses     18659    8066   -10593     
Flag Coverage Δ
tests 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...lation/rmf_robot_sim_common/src/slotcar_common.cpp
...uilding_sim_gazebo_plugins/src/crowd_simulator.hpp
...uilding_sim_gazebo_plugins/src/crowd_simulator.hpp
...tion/rmf_robot_sim_common/src/dispenser_common.cpp
...uilding_sim_gazebo_plugins/src/crowd_simulator.cpp
...tion/rmf_robot_sim_gazebo_plugins/src/readonly.cpp
...ation/rmf_robot_sim_common/src/readonly_common.cpp
...rmf_building_sim_common/crowd_simulator_common.hpp
...uilding_sim_gazebo_plugins/src/crowd_simulator.cpp
...uilding_sim_gazebo_plugins/src/crowd_simulator.hpp
... and 302 more

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
remove snap_world_pose code

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
@ddengster ddengster marked this pull request as ready for review August 11, 2021 09:05
@luca-della-vedova luca-della-vedova added this to In Review in Research & Development via automation Aug 11, 2021
@luca-della-vedova
Copy link
Member

Before I look too much into the code I can see from a quick glance that mostly new functions are used (i.e. the ackermann topic callback, an update specifically for non holonomic vehicles), and not too much of the slotcar pre-existing code.
Hence I wonder if it would be cleaner / easier to maintain (avoiding slotcar becoming even more complex) if the ackermann vehicles existed in a separate plugin, or do you think there is enough shared logic between ackermann drives and normal slotcar robots to justify the code being part of the slotcar plugin?

@ddengster
Copy link
Contributor Author

ddengster commented Aug 11, 2021

There were some code like movement, battery usage, etc and I thought the potential of reusing them would be a good thing, however the movement code didn't turn out to be that suited. Still I think it can work out correctly once we've solved the bugs. The battery code is another part that would be useful to have in the future.

Still I think we can stick to this arrangement - I don't feel a new movement and path construction function warrants a new plugin.

Copy link
Member

@luca-della-vedova luca-della-vedova left a comment

Choose a reason for hiding this comment

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

Finished a first quick round of review, I think there is a bit of cleanup (there is quite a bit of commented code / unused variables scattered around), as well as documentation to help follow the logic better that can be done.

rmf_robot_sim_common/src/slotcar_common.cpp Outdated Show resolved Hide resolved
rmf_robot_sim_common/src/slotcar_common.cpp Outdated Show resolved Hide resolved
rmf_robot_sim_common/src/slotcar_common.cpp Outdated Show resolved Hide resolved
Eigen::Vector2d tangent0 = wp[1] + tangent_length * wp1_to_wp0_norm;
Eigen::Vector2d tangent1 = wp[1] + tangent_length * wp1_to_wp2_norm;

// shorten the last trajectory and set it's heading
Copy link
Member

Choose a reason for hiding this comment

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

Nit, typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what's the typo? last?

Copy link
Member

Choose a reason for hiding this comment

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

it's -> its

rmf_robot_sim_common/src/slotcar_common.cpp Show resolved Hide resolved
rmf_robot_sim_ignition_plugins/src/slotcar.cpp Outdated Show resolved Hide resolved
rmf_robot_sim_ignition_plugins/src/slotcar.cpp Outdated Show resolved Hide resolved
rmf_robot_sim_ignition_plugins/src/slotcar.cpp Outdated Show resolved Hide resolved
rmf_robot_sim_common/src/slotcar_common.cpp Show resolved Hide resolved
rmf_robot_sim_common/src/slotcar_common.cpp Show resolved Hide resolved
account for robot names in ackmann_path_request
remove unneeded world pose condition

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
add condition for ackmann_path_request subscription

Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
Signed-off-by: ddengster <ed.fan@osrfoundation.org>
@ddengster ddengster merged commit a80cb6e into main Aug 17, 2021
Research & Development automation moved this from In Review to Done Aug 17, 2021
@ddengster ddengster deleted the feature/nonholonomic branch August 17, 2021 02:50
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