3#include <message_filters/subscriber.h>
4#include <message_filters/sync_policies/approximate_time.h>
5#include <message_filters/synchronizer.h>
6#include <message_filters/time_synchronizer.h>
12#include <rclcpp/rclcpp.hpp>
13#include <std_srvs/srv/trigger.hpp>
17#include "custom_interfaces/msg/control_command.hpp"
18#include "custom_interfaces/msg/operational_status.hpp"
19#include "custom_interfaces/msg/wheel_rpm.hpp"
35 rclcpp::Subscription<custom_interfaces::msg::OperationalStatus>::SharedPtr
42 message_filters::sync_policies::ApproximateTime<custom_interfaces::msg::WheelRPM,
43 custom_interfaces::msg::WheelRPM>;
45 std::shared_ptr<message_filters::Synchronizer<WSSPolicy>>
_sync_;
47 rclcpp::TimerBase::SharedPtr
71 rclcpp::Client<std_srvs::srv::Trigger>::SharedFuture future)
const;
79 void mission_decider(custom_interfaces::msg::OperationalStatus::SharedPtr mission_signal);
Class responsible for the Inspection Mission of the car.
rclcpp::Subscription< custom_interfaces::msg::OperationalStatus >::SharedPtr _mission_signal_subscription_
rclcpp::Clock _clock_
Timer for main callback.
void publish_controls(double throttle, double steering) const
Publishes the control command.
void inspection_script()
Function to publish control command while time is less than the defined time limit.
rclcpp::Publisher< custom_interfaces::msg::ControlCommand >::SharedPtr _control_command_publisher_
void mission_decider(custom_interfaces::msg::OperationalStatus::SharedPtr mission_signal)
recieves GoSignal and stores the mission that should be ran
rclcpp::Subscription< custom_interfaces::msg::WheelRPM >::SharedPtr _motor_rpm_subscription_
std::shared_ptr< message_filters::Synchronizer< WSSPolicy > > _sync_
rclcpp::TimerBase::SharedPtr _mission_end_timer_
InspectionMission()
Contruct a new Inspection Mission with constants defined in file.
InspectionFunctions _inspection_object_
Ellapsed time in seconds.
void update_rpms_callback(const custom_interfaces::msg::WheelRPM &motor_rpm)
Function to update the current rpms of the wheels.
void end_of_mission()
Rotations per minute of the motor.
rclcpp::Client< std_srvs::srv::Trigger >::SharedPtr _emergency_client_
rclcpp::Client< std_srvs::srv::Trigger >::SharedPtr _finish_client_
double _motor_rpm_
Mission to be executed;.
rclcpp::TimerBase::SharedPtr _timer_
message_filters::sync_policies::ApproximateTime< custom_interfaces::msg::WheelRPM, custom_interfaces::msg::WheelRPM > WSSPolicy
void handle_end_of_mission_response(rclcpp::Client< std_srvs::srv::Trigger >::SharedFuture future) const
Function to end communication of end of mission.
rclcpp::TimerBase::SharedPtr _main_callback_timer_
common_lib::competition_logic::Mission _mission_
Flag to start the mission.
bool _mission_end_timer_started_
Timer for repetition of end of mission signal.
rclcpp::Time _initial_time_