Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <vector>
#include <memory>
#include <functional>

namespace rmf_fleet_adapter {
namespace agv {
Expand Down Expand Up @@ -101,7 +102,8 @@ class RobotUpdateHandle
rmf_utils::optional<rmf_traffic::Duration> maximum_delay() const;

/// Get the schedule participant of this robot
rmf_traffic::schedule::Participant& get_participant();
rmf_utils::optional<std::reference_wrapper<rmf_traffic::schedule::Participant>>
get_participant();

class Implementation;
private:
Expand Down
7 changes: 4 additions & 3 deletions rmf_fleet_adapter/src/full_control/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@ class FleetDriverRobotCommandHandle
rmf_traffic_ros2::convert(state.location.t),
positions);

auto& participant = _travel_info.updater->get_participant();
participant.set(
{rmf_traffic::Route{state.location.level_name, trajectory}});
auto participant = _travel_info.updater->get_participant();
if (participant)
participant.value().get().set(
{rmf_traffic::Route{state.location.level_name, trajectory}});
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ RobotUpdateHandle::maximum_delay() const
}

//==============================================================================
rmf_traffic::schedule::Participant&
RobotUpdateHandle::get_participant()
rmf_utils::optional<std::reference_wrapper<rmf_traffic::schedule::Participant>>
RobotUpdateHandle::get_participant()
{
if (const auto context = _pimpl->get_context())
{
auto& itinerary = context->itinerary();
return itinerary;
}
return rmf_utils::nullopt;
}

//==============================================================================
Expand Down