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

Add API to update speed limits for lanes and publish LaneStates message #217

Merged
merged 13 commits into from
Sep 19, 2022

Conversation

Yadunund
Copy link
Member

Requires: open-rmf/rmf_internal_msgs#43

This PR adds two new public APIs to FleetUpdateHandle

  1. void limit_lane_speeds(std::vector<SpeedLimitRequest> requests) : To impose speed limits on lanes where SpeedLimitRequest is a pimpled class. I'm not sure if its better to have this as a class or define it as an unordered_map<std::size_t, double>. Or even just std::vector<rmf_fleet_msgs::msg::SpeedLimitedLane>. Alternatively, would it be better to just accept std::vecotr<rmf_fleet_msgs::msg::SpeedLimitRequest> and have a single API limit and remove lane speeds?

  2. void remove_speed_limits(std::vector<std::size_t> requests): To remove any imposed speed limits

Anytime lanes are open/closed or speed limits are changed, a LaneStates msg is published over /lane_states topic.

I've also updated the implementation in the legacy full_control adapter to include a subscription interface for SpeedLimitRequest. It still publishes the /closed_lanes topic which is technically deprecated by the newer /lane_states that includes speed limited lanes.

TODO: Update python bindings once CPP API passes review.

Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
@Yadunund Yadunund requested a review from mxgrey June 28, 2022 12:22
Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@gmail.com>
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #217 (c1d27cf) into main (3be4edf) will increase coverage by 0.11%.
The diff coverage is n/a.

❗ Current head c1d27cf differs from pull request most recent head 5d213ac. Consider uploading reports for the commit 5d213ac to get more accurate results

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   17.61%   17.73%   +0.11%     
==========================================
  Files         209      844     +635     
  Lines       19351    78180   +58829     
  Branches     9297    37564   +28267     
==========================================
+ Hits         3409    13865   +10456     
- Misses      12274    49387   +37113     
- Partials     3668    14928   +11260     
Flag Coverage Δ
tests 17.73% <ø> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
...adapter/src/rmf_fleet_adapter/events/GoToPlace.cpp
...ter/src/rmf_fleet_adapter/agv/EasyTrafficLight.cpp
...pp/RxCpp-4.1.0/Rx/v2/src/rxcpp/rx-coordination.hpp
...eet_adapter/src/rmf_fleet_adapter/agv/Waypoint.cpp
...pter/src/rmf_fleet_adapter/phases/DispenseItem.cpp
.../rmf_fleet_adapter/test/test_read_only_adapter.cpp
..._fleet_adapter/src/rmf_fleet_adapter/Reporting.cpp
...xCpp-4.1.0/Rx/v2/src/rxcpp/subjects/rx-subject.hpp
..._fleet_adapter/src/robot_state_aggregator/main.cpp
...-4.1.0/Rx/v2/src/rxcpp/schedulers/rx-immediate.hpp
... and 1043 more

@Yadunund
Copy link
Member Author

@mxgrey if the changes here are good I can update the python bindings and try to get this merged for the release

@mxgrey mxgrey merged commit feee55a into main Sep 19, 2022
@mxgrey mxgrey deleted the feature/speed_limits_and_lane_states branch September 19, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants