Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
InspectionMission Class Reference

Class responsible for the Inspection Mission of the car. More...

#include <inspection_ros.hpp>

Inheritance diagram for InspectionMission:
Inheritance graph
Collaboration diagram for InspectionMission:
Collaboration graph

Public Member Functions

void mission_decider (custom_interfaces::msg::OperationalStatus::SharedPtr mission_signal)
 recieves GoSignal and stores the mission that should be ran
 
void inspection_script ()
 Function to publish control command while time is less than the defined time limit.
 
void update_rpms_callback (const custom_interfaces::msg::WheelRPM &motor_rpm)
 Function to update the current rpms of the wheels.
 
void publish_controls (double throttle, double steering) const
 Publishes the control command.
 
 InspectionMission ()
 Contruct a new Inspection Mission with constants defined in file.
 

Private Types

using WSSPolicy = message_filters::sync_policies::ApproximateTime< custom_interfaces::msg::WheelRPM, custom_interfaces::msg::WheelRPM >
 

Private Member Functions

void end_of_mission ()
 Rotations per minute of the motor.
 
void handle_end_of_mission_response (rclcpp::Client< std_srvs::srv::Trigger >::SharedFuture future) const
 Function to end communication of end of mission.
 

Private Attributes

rclcpp::Client< std_srvs::srv::Trigger >::SharedPtr _finish_client_
 
rclcpp::Client< std_srvs::srv::Trigger >::SharedPtr _emergency_client_
 
rclcpp::Publisher< custom_interfaces::msg::ControlCommand >::SharedPtr _control_command_publisher_
 
rclcpp::Subscription< custom_interfaces::msg::OperationalStatus >::SharedPtr _mission_signal_subscription_
 
rclcpp::Subscription< custom_interfaces::msg::WheelRPM >::SharedPtr _motor_rpm_subscription_
 
rclcpp::TimerBase::SharedPtr _timer_
 
std::shared_ptr< message_filters::Synchronizer< WSSPolicy > > _sync_
 
rclcpp::TimerBase::SharedPtr _mission_end_timer_
 
bool _mission_end_timer_started_ = false
 Timer for repetition of end of mission signal.
 
bool _car_stopped_ = false
 
rclcpp::TimerBase::SharedPtr _main_callback_timer_
 
rclcpp::Clock _clock_
 Timer for main callback.
 
rclcpp::Time _initial_time_
 
InspectionFunctions _inspection_object_ = InspectionFunctions()
 Ellapsed time in seconds.
 
bool _go_ = false
 
common_lib::competition_logic::Mission _mission_
 Flag to start the mission.
 
double _motor_rpm_ = 0.0
 Mission to be executed;.
 

Detailed Description

Class responsible for the Inspection Mission of the car.

This class inherits from rclcpp::Node, subscribing to current velocity and publishing control commands.

Definition at line 29 of file inspection_ros.hpp.

Member Typedef Documentation

◆ WSSPolicy

using InspectionMission::WSSPolicy = message_filters::sync_policies::ApproximateTime<custom_interfaces::msg::WheelRPM, custom_interfaces::msg::WheelRPM>
private

Definition at line 41 of file inspection_ros.hpp.

Constructor & Destructor Documentation

◆ InspectionMission()

InspectionMission::InspectionMission ( )

Contruct a new Inspection Mission with constants defined in file.

Definition at line 8 of file inspection_ros.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ end_of_mission()

void InspectionMission::end_of_mission ( )
private

Rotations per minute of the motor.

Function for communication of end of mission (or emergency according to the mission)

Definition at line 172 of file inspection_ros.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_end_of_mission_response()

void InspectionMission::handle_end_of_mission_response ( rclcpp::Client< std_srvs::srv::Trigger >::SharedFuture  future) const
private

Function to end communication of end of mission.

Definition at line 190 of file inspection_ros.cpp.

Here is the caller graph for this function:

◆ inspection_script()

void InspectionMission::inspection_script ( )

Function to publish control command while time is less than the defined time limit.

Parameters
current_rpmrotations of the wheels per minute

Definition at line 90 of file inspection_ros.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mission_decider()

void InspectionMission::mission_decider ( custom_interfaces::msg::OperationalStatus::SharedPtr  mission_signal)

recieves GoSignal and stores the mission that should be ran

Parameters
mission_signalGoSignal

Definition at line 48 of file inspection_ros.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_controls()

void InspectionMission::publish_controls ( double  throttle,
double  steering 
) const

Publishes the control command.

Parameters
throttlethrottle to be applied
steeringsteering angle to be applied

Definition at line 163 of file inspection_ros.cpp.

Here is the caller graph for this function:

◆ update_rpms_callback()

void InspectionMission::update_rpms_callback ( const custom_interfaces::msg::WheelRPM &  motor_rpm)

Function to update the current rpms of the wheels.

Parameters
motor_rpmrotations of the motor per minute

Definition at line 85 of file inspection_ros.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _car_stopped_

bool InspectionMission::_car_stopped_ = false
private

Definition at line 50 of file inspection_ros.hpp.

◆ _clock_

rclcpp::Clock InspectionMission::_clock_
private

Timer for main callback.

Definition at line 52 of file inspection_ros.hpp.

◆ _control_command_publisher_

rclcpp::Publisher<custom_interfaces::msg::ControlCommand>::SharedPtr InspectionMission::_control_command_publisher_
private

Definition at line 33 of file inspection_ros.hpp.

◆ _emergency_client_

rclcpp::Client<std_srvs::srv::Trigger>::SharedPtr InspectionMission::_emergency_client_
private

Definition at line 32 of file inspection_ros.hpp.

◆ _finish_client_

rclcpp::Client<std_srvs::srv::Trigger>::SharedPtr InspectionMission::_finish_client_
private

Definition at line 31 of file inspection_ros.hpp.

◆ _go_

bool InspectionMission::_go_ = false
private

Definition at line 56 of file inspection_ros.hpp.

◆ _initial_time_

rclcpp::Time InspectionMission::_initial_time_
private

Definition at line 53 of file inspection_ros.hpp.

◆ _inspection_object_

InspectionFunctions InspectionMission::_inspection_object_ = InspectionFunctions()
private

Ellapsed time in seconds.

Definition at line 54 of file inspection_ros.hpp.

◆ _main_callback_timer_

rclcpp::TimerBase::SharedPtr InspectionMission::_main_callback_timer_
private

Definition at line 51 of file inspection_ros.hpp.

◆ _mission_

common_lib::competition_logic::Mission InspectionMission::_mission_
private

Flag to start the mission.

Definition at line 57 of file inspection_ros.hpp.

◆ _mission_end_timer_

rclcpp::TimerBase::SharedPtr InspectionMission::_mission_end_timer_
private

Definition at line 48 of file inspection_ros.hpp.

◆ _mission_end_timer_started_

bool InspectionMission::_mission_end_timer_started_ = false
private

Timer for repetition of end of mission signal.

Definition at line 49 of file inspection_ros.hpp.

◆ _mission_signal_subscription_

rclcpp::Subscription<custom_interfaces::msg::OperationalStatus>::SharedPtr InspectionMission::_mission_signal_subscription_
private

Definition at line 36 of file inspection_ros.hpp.

◆ _motor_rpm_

double InspectionMission::_motor_rpm_ = 0.0
private

Mission to be executed;.

Definition at line 59 of file inspection_ros.hpp.

◆ _motor_rpm_subscription_

rclcpp::Subscription<custom_interfaces::msg::WheelRPM>::SharedPtr InspectionMission::_motor_rpm_subscription_
private

Definition at line 37 of file inspection_ros.hpp.

◆ _sync_

std::shared_ptr<message_filters::Synchronizer<WSSPolicy> > InspectionMission::_sync_
private

Definition at line 45 of file inspection_ros.hpp.

◆ _timer_

rclcpp::TimerBase::SharedPtr InspectionMission::_timer_
private

Definition at line 38 of file inspection_ros.hpp.


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