![]() |
Galaxis Codebase
1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
|
#include <ControllerNode.hpp>


Public Member Functions | |
| ControllerNode () | |
Private Member Functions | |
| void | loop () |
| void | send_debug_messages () |
| void | send_simulation_messages () |
| void | calculate_erpm () |
| void | calculate_turn_angle () |
| void | publish_control_values (ControlMotionType::UniquePtr msg) |
| void | on_measurement_callback (MeasurementsType::SharedPtr msg) |
| void | on_pathpolynom_callback (PathpolynomType::SharedPtr msg) |
| void | on_controller_reference_callback (ControllerReferenceType::SharedPtr msg) |
| void | on_map_debug_image_callback (const sensor_msgs::msg::Image::ConstSharedPtr &msg) |
| rcl_interfaces::msg::SetParametersResult | new_parameters_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Private Attributes | |
| bool | m_debugMode = false |
| bool | m_simulationMode = false |
| std::atomic< bool > | m_disableController |
| std::atomic< bool > | m_stop_ControllerNode = false |
| std::atomic< bool > | m_start_ParkingNode = false |
| rclcpp::Publisher< ControlMotionType >::SharedPtr | m_controlValuesPubSPtr |
| rclcpp::Publisher< ControlLightsType >::SharedPtr | m_controlLightsPubSPtr |
| rclcpp::Publisher< DebugControllerType >::SharedPtr | m_debugControllerPubSPtr |
| rclcpp::Publisher< SimulationVehicleControlType >::SharedPtr | m_simulationVehicleControlPubSPtr |
| rclcpp::Publisher< std_msgs::msg::UInt8 >::SharedPtr | m_lightsStdPublisherSPtr |
| rclcpp::Subscription< PathpolynomType >::SharedPtr | m_pathPolynomSubSPtr |
| rclcpp::Subscription< ControllerReferenceType >::SharedPtr | m_controllerRefSubSPtr |
| rclcpp::Subscription< MeasurementsType >::SharedPtr | m_measurementSubSPtr |
| image_transport::Subscriber | m_localMapDebugImgSubscription |
| image_transport::Publisher | m_localMapDebugTrajectoryImgPublisher |
| MeasurementsType::SharedPtr | m_lastReceivedMeasurementSPtr |
| std::mutex | m_measurementMtx |
| std::shared_ptr< ControlLightsType > | m_lastSentControlLights |
| PathpolynomType::SharedPtr | m_lastReceivedPathpolynomSPtr |
| std::shared_ptr< PolySpline > | m_currentReferenceSplineSPtr |
| std::shared_ptr< galaxis::line_markings_reference_t > | m_currentLineMarkingReferenceSPtr |
| std::mutex | m_pathPolynomMtx |
| std::atomic< int64_t > | m_lastPolynomUpdateTimestamp |
| std::shared_ptr< galaxis::control::TwoAndAHalfCarrots > | m_controlTwoAndAHalfCarrotsSPtr |
| std::shared_ptr< std::vector< float > > | m_turnAnglesSPtr |
| std::mutex | m_controlMtx |
| std::atomic< float > | m_currentVelocity = 0.f |
| std::atomic< float > | m_currentVelocityApplied = 0.f |
| std::atomic< float > | m_currentVelocityReference = 0.f |
| std::tuple< float, float > | m_currentTurnAngles = std::make_tuple(0.f, 0.f) |
| std::tuple< std::atomic< bool >, std::atomic< bool > > | m_currentIndicatorState = std::make_tuple(false, false) |
| std::atomic< float > | m_minVelocity = 0.4f |
| std::atomic< float > | m_velocityRollingAverageFactorForNewVelocity = 0.01f |
Additional Inherited Members | |
Protected Member Functions inherited from GalaxisNode | |
| GalaxisNode ()=delete | |
| GalaxisNode (std::string p_name, unsigned int p_heartbeatTimePeriod) | |
| GalaxisNode (std::string p_name) | |
| template<typename MsgSPtr > | |
| void | tickSub (std::map< galaxis::serviceStates::State, std::function< void(const MsgSPtr)>> const *p_functionMapPtr, MsgSPtr const p_message) |
| template<typename... Args> | |
| void | tickPub (std::map< galaxis::serviceStates::State, std::function< void(Args...)>> const *p_functionMapPtr, Args... p_args) |
| void | register_callback (std::function< void(galaxis::serviceStates::State)> p_function) |
| void | service_state_callback (ServiceStateType::SharedPtr const p_msgSPtr) |
| galaxis::serviceStates::State | get_current_service_state () const |
| void | enable_parameters (std::function< rcl_interfaces::msg::SetParametersResult(const std::vector< rclcpp::Parameter > &)> callbackFunc) |
| void | create_parameters (std::shared_ptr< json > configJsonSPtr) |
| json const & | get_global_settings () |
Definition at line 22 of file ControllerNode.hpp.
| ControllerNode::ControllerNode | ( | ) |
Definition at line 19 of file ControllerNode.cpp.
References calculate_turn_angle(), galaxis::controllerSettings::carWheelbase, galaxis::controllerSettings::carWheelbaseSimulationDrDrift, GalaxisNode::enable_parameters(), GalaxisNode::get_global_settings(), galaxis::utils::log(), loop(), m_controllerRefSubSPtr, m_controlLightsPubSPtr, m_controlTwoAndAHalfCarrotsSPtr, m_controlValuesPubSPtr, m_currentReferenceSplineSPtr, m_currentVelocity, m_currentVelocityApplied, m_debugControllerPubSPtr, m_debugMode, m_disableController, m_lightsStdPublisherSPtr, m_localMapDebugImgSubscription, m_localMapDebugTrajectoryImgPublisher, m_measurementSubSPtr, m_pathPolynomSubSPtr, m_simulationMode, m_simulationVehicleControlPubSPtr, m_turnAnglesSPtr, new_parameters_callback(), on_controller_reference_callback(), on_map_debug_image_callback(), on_measurement_callback(), on_pathpolynom_callback(), and galaxis::utils::read_json_file().

|
private |
|
private |
Definition at line 259 of file ControllerNode.cpp.
References galaxis::utils::log(), m_controlMtx, m_controlTwoAndAHalfCarrotsSPtr, m_currentLineMarkingReferenceSPtr, m_currentReferenceSplineSPtr, m_currentTurnAngles, m_currentVelocity, m_currentVelocityApplied, m_currentVelocityReference, m_minVelocity, m_pathPolynomMtx, m_simulationMode, and m_velocityRollingAverageFactorForNewVelocity.
Referenced by ControllerNode(), and on_pathpolynom_callback().


|
private |
Definition at line 122 of file ControllerNode.cpp.
References galaxis::servoSettings::angleToServoSetting(), galaxis::utils::log_warning(), m_controlLightsPubSPtr, m_currentIndicatorState, m_currentTurnAngles, m_currentVelocity, m_debugMode, m_lastPolynomUpdateTimestamp, m_lastSentControlLights, m_lightsStdPublisherSPtr, m_simulationMode, m_stop_ControllerNode, publish_control_values(), send_debug_messages(), send_simulation_messages(), and galaxis::motorSettings::velocityToErpm().
Referenced by ControllerNode().


|
private |
Definition at line 431 of file ControllerNode.cpp.
References galaxis::utils::log(), galaxis::utils::log_warning(), m_controlTwoAndAHalfCarrotsSPtr, m_minVelocity, m_start_ParkingNode, m_stop_ControllerNode, and m_velocityRollingAverageFactorForNewVelocity.
Referenced by ControllerNode().


|
private |
Definition at line 353 of file ControllerNode.cpp.
References galaxis::utils::log(), m_currentIndicatorState, m_currentVelocityReference, and m_disableController.
Referenced by ControllerNode().


|
private |
Definition at line 363 of file ControllerNode.cpp.
References galaxis::utils::log(), galaxis::autopilot::lookupLookBehindCarCM, m_controlMtx, m_controlTwoAndAHalfCarrotsSPtr, and m_localMapDebugTrajectoryImgPublisher.
Referenced by ControllerNode().


|
private |
Definition at line 302 of file ControllerNode.cpp.
References galaxis::motorSettings::erpmToVelocity(), galaxis::utils::log(), galaxis::utils::log_warning(), m_currentVelocityApplied, m_lastReceivedMeasurementSPtr, and m_measurementMtx.
Referenced by ControllerNode().


|
private |
Definition at line 313 of file ControllerNode.cpp.
References calculate_turn_angle(), galaxis::utils::log(), m_currentLineMarkingReferenceSPtr, m_currentReferenceSplineSPtr, m_lastPolynomUpdateTimestamp, m_lastReceivedPathpolynomSPtr, and m_pathPolynomMtx.
Referenced by ControllerNode().


|
private |
Definition at line 343 of file ControllerNode.cpp.
References galaxis::utils::log(), and m_controlValuesPubSPtr.
Referenced by loop().


|
private |
Definition at line 204 of file ControllerNode.cpp.
References galaxis::utils::log(), m_controlMtx, m_controlTwoAndAHalfCarrotsSPtr, m_currentTurnAngles, m_currentVelocity, m_debugControllerPubSPtr, m_lastReceivedPathpolynomSPtr, and m_pathPolynomMtx.
Referenced by loop().


|
private |
Definition at line 249 of file ControllerNode.cpp.
References m_currentTurnAngles, m_currentVelocity, and m_simulationVehicleControlPubSPtr.
Referenced by loop().

|
private |
Definition at line 40 of file ControllerNode.hpp.
Referenced by ControllerNode().
|
private |
Definition at line 33 of file ControllerNode.hpp.
Referenced by ControllerNode(), and loop().
|
private |
Definition at line 64 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), on_map_debug_image_callback(), and send_debug_messages().
|
private |
Definition at line 62 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), ControllerNode(), new_parameters_callback(), on_map_debug_image_callback(), and send_debug_messages().
|
private |
Definition at line 32 of file ControllerNode.hpp.
Referenced by ControllerNode(), and publish_control_values().
|
private |
Definition at line 71 of file ControllerNode.hpp.
Referenced by loop(), and on_controller_reference_callback().
|
private |
Definition at line 56 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), and on_pathpolynom_callback().
|
private |
Definition at line 55 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), ControllerNode(), and on_pathpolynom_callback().
|
private |
Definition at line 70 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), loop(), send_debug_messages(), and send_simulation_messages().
|
private |
Definition at line 67 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), ControllerNode(), loop(), send_debug_messages(), and send_simulation_messages().
|
private |
Definition at line 68 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), ControllerNode(), and on_measurement_callback().
|
private |
Definition at line 69 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), and on_controller_reference_callback().
|
private |
Definition at line 34 of file ControllerNode.hpp.
Referenced by ControllerNode(), and send_debug_messages().
|
private |
Definition at line 24 of file ControllerNode.hpp.
Referenced by ControllerNode(), and loop().
|
private |
Definition at line 26 of file ControllerNode.hpp.
Referenced by ControllerNode(), and on_controller_reference_callback().
|
private |
Definition at line 59 of file ControllerNode.hpp.
Referenced by loop(), and on_pathpolynom_callback().
|
private |
Definition at line 47 of file ControllerNode.hpp.
Referenced by on_measurement_callback().
|
private |
Definition at line 54 of file ControllerNode.hpp.
Referenced by on_pathpolynom_callback(), and send_debug_messages().
|
private |
Definition at line 51 of file ControllerNode.hpp.
Referenced by loop().
|
private |
Definition at line 36 of file ControllerNode.hpp.
Referenced by ControllerNode(), and loop().
|
private |
Definition at line 43 of file ControllerNode.hpp.
Referenced by ControllerNode().
|
private |
Definition at line 44 of file ControllerNode.hpp.
Referenced by ControllerNode(), and on_map_debug_image_callback().
|
private |
Definition at line 48 of file ControllerNode.hpp.
Referenced by on_measurement_callback().
|
private |
Definition at line 41 of file ControllerNode.hpp.
Referenced by ControllerNode().
|
private |
Definition at line 72 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), and new_parameters_callback().
|
private |
Definition at line 58 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), on_pathpolynom_callback(), and send_debug_messages().
|
private |
Definition at line 39 of file ControllerNode.hpp.
Referenced by ControllerNode().
|
private |
Definition at line 25 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), ControllerNode(), and loop().
|
private |
Definition at line 35 of file ControllerNode.hpp.
Referenced by ControllerNode(), and send_simulation_messages().
|
private |
Definition at line 29 of file ControllerNode.hpp.
Referenced by new_parameters_callback().
|
private |
Definition at line 28 of file ControllerNode.hpp.
Referenced by loop(), and new_parameters_callback().
|
private |
Definition at line 63 of file ControllerNode.hpp.
Referenced by ControllerNode().
|
private |
Definition at line 73 of file ControllerNode.hpp.
Referenced by calculate_turn_angle(), and new_parameters_callback().