chrono::vehicle::ChHumanDriver Class Reference

Description

Closed-loop path-follower and speed maintaining driver model.

A driver model that combines a path steering controller and a speed controller. The controller adjusts the steering input to follow the prescribed path. The output also adjusts throttle and braking inputs in order to maintain a varying speed that depends on the curvature of the road.

#include <ChHumanDriver.h>

Inheritance diagram for chrono::vehicle::ChHumanDriver:
Collaboration diagram for chrono::vehicle::ChHumanDriver:

Public Member Functions

 ChHumanDriver (ChVehicle &vehicle, std::shared_ptr< ChBezierCurve > path, const std::string &path_name, bool isClosedPath=false, double road_width=5.0, double max_wheel_turn_angle=0, double axle_space=2.5)
 Construct using the specified Bezier curve. More...
 
 ChHumanDriver (const std::string &filename, ChVehicle &vehicle, std::shared_ptr< ChBezierCurve > path, const std::string &path_name, bool isClosedPath=false, double road_width=5.0, double max_wheel_turn_angle=0, double axle_space=2.5)
 Construct using a JSON parameter file. More...
 
virtual void Advance (double step) override
 Advance the state of this driver system by the specified duration. More...
 
virtual void Initialize () override
 Initialize the driver system.
 
void ExportPathPovray (const std::string &out_dir)
 Export the Bezier curve for POV-Ray postprocessing.
 
void SetPreviewTime (double Tp=0.5)
 
void SetLateralGains (double Klat=0.1, double Kug=0)
 
void SetLongitudinalGains (double Klong=0.1, double Kplus=0.1, double Kminus=0.1)
 
void SetSpeedRange (double u0=10.0, double umax=30.0)
 
ChVector GetTargetLocation ()
 
ChVector GetSentinelLocation ()
 
double GetTraveledDistance ()
 
double GetAverageSpeed ()
 
double GetMaxSpeed ()
 
double GetMinSpeed ()
 
double GetMaxLatAcc ()
 
double GetMinLatAcc ()
 
- Public Member Functions inherited from chrono::vehicle::ChDriver
 ChDriver (ChVehicle &vehicle)
 
double GetThrottle () const
 Get the driver throttle input (in the range [0,1])
 
double GetSteering () const
 Get the driver steering input (in the range [-1,+1])
 
double GetBraking () const
 Get the driver braking input (in the range [0,1])
 
Inputs GetInputs () const
 Get all current inputs at once.
 
virtual void Synchronize (double time)
 Update the state of this driver system at the current time.
 
bool LogInit (const std::string &filename)
 Initialize output file for recording driver inputs.
 
bool Log (double time)
 Record the current driver inputs to the log file.
 
void SetSteering (double val, double min_val=-1, double max_val=1)
 Overwrite the value for the driver steering input.
 
void SetThrottle (double val, double min_val=0, double max_val=1)
 Overwrite the value for the driver throttle input.
 
void SetBraking (double val, double min_val=0, double max_val=1)
 Overwrite the value for the driver braking input.
 

Additional Inherited Members

- Protected Attributes inherited from chrono::vehicle::ChDriver
ChVehiclem_vehicle
 reference to associated vehicle
 
double m_throttle
 current value of throttle input
 
double m_steering
 current value of steering input
 
double m_braking
 current value of braking input
 

Constructor & Destructor Documentation

◆ ChHumanDriver() [1/2]

chrono::vehicle::ChHumanDriver::ChHumanDriver ( ChVehicle vehicle,
std::shared_ptr< ChBezierCurve path,
const std::string &  path_name,
bool  isClosedPath = false,
double  road_width = 5.0,
double  max_wheel_turn_angle = 0,
double  axle_space = 2.5 
)

Construct using the specified Bezier curve.

Parameters
vehicleassociated vehicle
pathBezier curve with target path
path_namename of the path curve
isClosedPathTreat the path as a closed loop
road_widthroad width
max_wheel_turn_anglemaximum wheel turning angle
axle_spacewheel track

◆ ChHumanDriver() [2/2]

chrono::vehicle::ChHumanDriver::ChHumanDriver ( const std::string &  filename,
ChVehicle vehicle,
std::shared_ptr< ChBezierCurve path,
const std::string &  path_name,
bool  isClosedPath = false,
double  road_width = 5.0,
double  max_wheel_turn_angle = 0,
double  axle_space = 2.5 
)

Construct using a JSON parameter file.

Parameters
filenamepath of the JSON file
vehicleassociated vehicle
pathBezier curve with target path
path_namename of the path curve
isClosedPathTreat the path as a closed loop
road_widthroad width
max_wheel_turn_anglemaximum wheel turning angle
axle_spacewheel track

Member Function Documentation

◆ Advance()

void chrono::vehicle::ChHumanDriver::Advance ( double  step)
overridevirtual

Advance the state of this driver system by the specified duration.

< normal vector pointing to actual yaw center

< normal vector pointing to actual vehicle front

Reimplemented from chrono::vehicle::ChDriver.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_vehicle/driver/ChHumanDriver.h
  • /builds/uwsbel/chrono/src/chrono_vehicle/driver/ChHumanDriver.cpp