Autonomous Racing  1
f1tenth Project Group of Technical University Dortmund, Germany
DriveParametersSource Class Reference

#include <drive_parameters_source.h>

Public Member Functions

 DriveParametersSource (ros::NodeHandle *node_handle, const char *topic, DriveParameterCallbackFunction update_callback, DriveMode drive_mode, ros::Duration timeout)
 Construct a new DriveParametersSource object, subscribes to the topic and stores the parameters into local variables. More...
 
bool isOutdated ()
 Returns true if no update was received for a certain time, determined by the timeout variable. More...
 
bool isIdle ()
 Returns true if the last update contained values close to 0 for both steering and throttle. If no update was received yet, this returns true. More...
 
DriveMode getDriveMode ()
 

Detailed Description

Definition at line 19 of file drive_parameters_source.h.

Constructor & Destructor Documentation

DriveParametersSource::DriveParametersSource ( ros::NodeHandle *  node_handle,
const char *  topic,
DriveParameterCallbackFunction  update_callback,
DriveMode  drive_mode,
ros::Duration  timeout 
)

Construct a new DriveParametersSource object, subscribes to the topic and stores the parameters into local variables.

Parameters
node_handleA node handle is needed to create a topic subscriber
topicThe name of the drive_param topic to subscribe to
update_callbackCallback function that will be called whenever a message was received
priorityPriority of the source. If multiple sources are not idle, the source with the highest priority is forwarded.
timeoutMessages will be deferred when they are older than this, in seconds.

Definition at line 4 of file drive_parameters_source.cpp.

Member Function Documentation

DriveMode DriveParametersSource::getDriveMode ( )

Definition at line 41 of file drive_parameters_source.cpp.

Here is the caller graph for this function:

bool DriveParametersSource::isIdle ( )

Returns true if the last update contained values close to 0 for both steering and throttle. If no update was received yet, this returns true.

Definition at line 36 of file drive_parameters_source.cpp.

Here is the caller graph for this function:

bool DriveParametersSource::isOutdated ( )

Returns true if no update was received for a certain time, determined by the timeout variable.

Definition at line 27 of file drive_parameters_source.cpp.

Here is the caller graph for this function:


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