Class State

Inheritance Relationships

Base Type

Class Documentation

class State : public rmf_task::CompositeData

Public Functions

RMF_TASK_DEFINE_COMPONENT(std::size_t, CurrentWaypoint)

The current waypoint of the robot state.

std::optional<std::size_t> waypoint() const
State &waypoint(std::size_t new_waypoint)
RMF_TASK_DEFINE_COMPONENT(double, CurrentOrientation)

The current orientation of the robot state.

std::optional<double> orientation() const
State &orientation(double new_orientation)
RMF_TASK_DEFINE_COMPONENT(rmf_traffic::Time, CurrentTime)

The current time for the robot.

std::optional<rmf_traffic::Time> time() const
State &time(rmf_traffic::Time new_time)
RMF_TASK_DEFINE_COMPONENT(std::size_t, DedicatedChargingPoint)

The dedicated charging point for this robot.

std::optional<std::size_t> dedicated_charging_waypoint() const
State &dedicated_charging_waypoint(std::size_t new_charging_waypoint)
RMF_TASK_DEFINE_COMPONENT(double, CurrentBatterySoC)

The current battery state of charge of the robot. This value is between 0.0 and 1.0.

std::optional<double> battery_soc() const
State &battery_soc(double new_battery_soc)
State &load_basic(const rmf_traffic::agv::Plan::Start &location, std::size_t charging_point, double battery_soc)

Load the basic state components expected for the planner.

Parameters:
  • location[in] The robot’s initial location data.

  • charging_point[in] The robot’s dedicated charging point.

  • battery_soc[in] The robot’s initial battery state of charge.

State &load(const rmf_traffic::agv::Plan::Start &location)

Load the plan start into the State. The location info will be split into CurrentWaypoint, CurrentOrientation, and CurrentTime data.

std::optional<rmf_traffic::agv::Plan::Start> project_plan_start(double default_orientation = 0.0, rmf_traffic::Time default_time = rmf_traffic::Time()) const

Project an rmf_traffic::agv::Plan::Start from this State.

If CurrentWaypoint is unavailable, this will return a std::nullopt. For any other components that are unavailable (CurrentOrientation or CurrentTime), the given default values will be used.

Parameters:
  • default_orientation[in] The orientation value that will be used if CurrentOrientation is not available in this State.

  • default_time[in] The time value that will be used if default_time is not available in this State.

std::optional<rmf_traffic::agv::Plan::Start> extract_plan_start() const

Extract an rmf_traffic::agv::Plan::Start from this State.

If any necessary component is missing (i.e. CurrentWaypoint, CurrentOrientation, or CurrentTime) then this will return a std::nullopt.