Skip to content

Commit

Permalink
add battery charging state (autowarefoundation#2256)
Browse files Browse the repository at this point in the history
Signed-off-by: Azumi SUZUKI <azumi.suzuki@tier4.jp>
  • Loading branch information
s-azumi authored and Geoffrey Biggs committed May 30, 2019
1 parent 101719b commit efab8ae
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ LocalizationInit|/current_pose|Waits until localizer is ready | Waits until curr
PlanningInit|/closest_waypoint|Waits unil planners are ready | Subscriber is set for /closest_waypoint.
VehicleInit|-|Waits until vehicle is ready for departure.|No implementation goes directly to vehilce ready state.
VehicleReady|-|Vehicle is ready to move.|Exits to VehicleEmergency when `emergency` key is given by state_cmd from other states, or if `emergency_flag` is set true by other states.
BatteryCharging|-|Charging the battery|Waits until `charging_end` key by state_cmd from other nodes(e.g. by AMS).
VehicleEmergency|-|Emergency is detected somewhere in the system. |Waits until `return_from_emergency` or `return_to_ready` key is by /state_cmd (e.g. by DecisionMakerPanel)

### Mission States
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,20 @@ autoware_states_vehicle:
-
StateName: VehicleReady
Transition:
-
Key: charge_start
Target: BatteryCharging
-
Key: emergency
Target: VehicleEmergency
Parent: ~
-
StateName: BatteryCharging
Transition:
-
Key: charge_end
Target: VehicleReady
Parent: ~
-
StateName: VehicleEmergency
Transition:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class DecisionMakerNode
void updatePlanningInitState(cstring_t& state_name, int status);
void updateVehicleInitState(cstring_t& state_name, int status);
void updateVehicleReadyState(cstring_t& state_name, int status);
void updateBatteryChargingState(cstring_t& state_name, int status);
void updateVehicleEmergencyState(cstring_t& state_name, int status);
// exit callback

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ void DecisionMakerNode::setupStateCallback(void)
std::bind(&DecisionMakerNode::entryVehicleReadyState, this, std::placeholders::_1, 0));
ctx_vehicle->setCallback(state_machine::CallbackType::UPDATE, "VehicleReady",
std::bind(&DecisionMakerNode::updateVehicleReadyState, this, std::placeholders::_1, 0));
ctx_vehicle->setCallback(state_machine::CallbackType::UPDATE, "BatteryCharging",
std::bind(&DecisionMakerNode::updateBatteryChargingState, this, std::placeholders::_1, 0));
ctx_vehicle->setCallback(state_machine::CallbackType::ENTRY, "VehicleEmergency",
std::bind(&DecisionMakerNode::entryVehicleEmergencyState, this, std::placeholders::_1, 0));
ctx_vehicle->setCallback(state_machine::CallbackType::UPDATE, "VehicleEmergency",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ void DecisionMakerNode::updateVehicleReadyState(cstring_t& state_name, int statu
}
}

void DecisionMakerNode::updateBatteryChargingState(cstring_t& state_name, int status)
{
}

void DecisionMakerNode::entryVehicleEmergencyState(cstring_t& state_name, int status)
{
}
Expand Down

0 comments on commit efab8ae

Please sign in to comment.