Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
apollo::canbus::VehicleController Class Referenceabstract

This is the interface class of vehicle controller. It defines pure virtual functions, and also some implemented common functions. More...

#include <vehicle_controller.h>

Inheritance diagram for apollo::canbus::VehicleController:
Inheritance graph
Collaboration diagram for apollo::canbus::VehicleController:
Collaboration graph

Public Member Functions

virtual ~VehicleController ()=default
 
virtual common::ErrorCode Init (const VehicleParameter &params, CanSender< ChassisDetail > *const can_sender, MessageManager< ChassisDetail > *const message_manager)=0
 initialize the vehicle controller. More...
 
virtual bool Start ()=0
 start the vehicle controller. More...
 
virtual void Stop ()=0
 stop the vehicle controller. More...
 
virtual Chassis chassis ()=0
 calculate and return the chassis. More...
 
virtual common::ErrorCode Update (const control::ControlCommand &command)
 update the vehicle controller. More...
 
virtual common::ErrorCode SetDrivingMode (const Chassis::DrivingMode &driving_mode)
 set vehicle to appointed driving mode. More...
 

Protected Member Functions

virtual Chassis::DrivingMode driving_mode ()
 
virtual void set_driving_mode (const Chassis::DrivingMode &driving_mode)
 

Protected Attributes

canbus::VehicleParameter params_
 
common::VehicleParam vehicle_params_
 
CanSender< ChassisDetail > * can_sender_ = nullptr
 
MessageManager< ChassisDetail > * message_manager_ = nullptr
 
bool is_initialized_ = false
 
Chassis::DrivingMode driving_mode_ = Chassis::COMPLETE_MANUAL
 
bool is_reset_ = false
 
std::mutex mode_mutex_
 

Detailed Description

This is the interface class of vehicle controller. It defines pure virtual functions, and also some implemented common functions.

Constructor & Destructor Documentation

◆ ~VehicleController()

virtual apollo::canbus::VehicleController::~VehicleController ( )
virtualdefault

Member Function Documentation

◆ chassis()

virtual Chassis apollo::canbus::VehicleController::chassis ( )
pure virtual

◆ driving_mode()

virtual Chassis::DrivingMode apollo::canbus::VehicleController::driving_mode ( )
protectedvirtual

◆ Init()

virtual common::ErrorCode apollo::canbus::VehicleController::Init ( const VehicleParameter &  params,
CanSender< ChassisDetail > *const  can_sender,
MessageManager< ChassisDetail > *const  message_manager 
)
pure virtual

initialize the vehicle controller.

Parameters
can_sendera pointer to canbus sender.
message_managera pointer to the message_manager.
Returns
error_code

◆ set_driving_mode()

virtual void apollo::canbus::VehicleController::set_driving_mode ( const Chassis::DrivingMode &  driving_mode)
protectedvirtual

◆ SetDrivingMode()

virtual common::ErrorCode apollo::canbus::VehicleController::SetDrivingMode ( const Chassis::DrivingMode &  driving_mode)
virtual

set vehicle to appointed driving mode.

Parameters
drivingmode to be appointed.
Returns
error_code

◆ Start()

virtual bool apollo::canbus::VehicleController::Start ( )
pure virtual

◆ Stop()

virtual void apollo::canbus::VehicleController::Stop ( )
pure virtual

◆ Update()

virtual common::ErrorCode apollo::canbus::VehicleController::Update ( const control::ControlCommand &  command)
virtual

update the vehicle controller.

Parameters
commandthe control command
Returns
error_code

Member Data Documentation

◆ can_sender_

CanSender<ChassisDetail>* apollo::canbus::VehicleController::can_sender_ = nullptr
protected

◆ driving_mode_

Chassis::DrivingMode apollo::canbus::VehicleController::driving_mode_ = Chassis::COMPLETE_MANUAL
protected

◆ is_initialized_

bool apollo::canbus::VehicleController::is_initialized_ = false
protected

◆ is_reset_

bool apollo::canbus::VehicleController::is_reset_ = false
protected

◆ message_manager_

MessageManager<ChassisDetail>* apollo::canbus::VehicleController::message_manager_ = nullptr
protected

◆ mode_mutex_

std::mutex apollo::canbus::VehicleController::mode_mutex_
protected

◆ params_

canbus::VehicleParameter apollo::canbus::VehicleController::params_
protected

◆ vehicle_params_

common::VehicleParam apollo::canbus::VehicleController::vehicle_params_
protected

The documentation for this class was generated from the following file: