-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multiple destinations to choose from. (#101)
Signed-off-by: Arjo Chakravarty <[email protected]> Signed-off-by: Michael X. Grey <[email protected]> Co-authored-by: Michael X. Grey <[email protected]>
- Loading branch information
Showing
4 changed files
with
261 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2023 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#include <rmf_utils/catch.hpp> | ||
|
||
#include <rmf_task_sequence/events/GoToPlace.hpp> | ||
|
||
#include "../utils.hpp" | ||
|
||
SCENARIO("Test GoToPlace") | ||
{ | ||
using GoToPlace = rmf_task_sequence::events::GoToPlace; | ||
|
||
auto description = GoToPlace::Description::make_for_one_of({0, 8, 12}); | ||
const auto parameters = make_test_parameters(); | ||
const auto constraints = make_test_constraints(); | ||
const auto now = std::chrono::steady_clock::now(); | ||
rmf_task::State initial_state; | ||
initial_state.waypoint(1) | ||
.orientation(0.0) | ||
.time(now) | ||
.dedicated_charging_waypoint(0) | ||
.battery_soc(1.0); | ||
|
||
const auto travel_estimator = rmf_task::TravelEstimator(*parameters); | ||
|
||
WHEN("Not constrained to any map") | ||
{ | ||
const auto model = description->make_model(initial_state, *parameters); | ||
const auto finish = model->estimate_finish( | ||
initial_state, now, *constraints, travel_estimator); | ||
|
||
REQUIRE(finish.has_value()); | ||
CHECK(finish->finish_state().waypoint() == 0); | ||
} | ||
|
||
WHEN("Constrained to the same map") | ||
{ | ||
description->prefer_same_map(true); | ||
const auto model = description->make_model(initial_state, *parameters); | ||
const auto finish = model->estimate_finish( | ||
initial_state, now, *constraints, travel_estimator); | ||
|
||
REQUIRE(finish.has_value()); | ||
CHECK(finish->finish_state().waypoint() == 8); | ||
} | ||
} |
Oops, something went wrong.