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


Public Member Functions | |
| ECUNode () | |
| void | init (std::shared_ptr< ECUHandler > _handler) |
| Initialises the ECUNode and saves the pointer to the ECU Handler. More... | |
| void | publishMeasurements (const EcuPacket *const packet, const std::array< std::chrono::duration< double, std::milli >, 10 > &diff_ms) |
| Publishes the new Measurements from the ECU on the apropriate Publishers. More... | |
Private Member Functions | |
| void | motion_callback (const ControlMotionType::SharedPtr p_msgSPtr) |
| Callback function on new message. Sends the Data to the ECUHandler to send to the ECU. More... | |
| void | lights_callback (const ControlLightsType::SharedPtr p_msgSPtr) |
| void | settingsvalues_callback (const SettingsValuesType::SharedPtr p_msgSPtr) |
| Callback function on new message. Sends the Data to the ECUHandler to send to the ECU. More... | |
Private Attributes | |
| rclcpp::Publisher< ButtonStateMessageType >::SharedPtr | m_buttonStatePubSPtr = nullptr |
| Publisher object for buttonStates. More... | |
| rclcpp::Publisher< MeasurementsType >::SharedPtr | m_measurementPubSPtr = nullptr |
| Publisher object for measurements. More... | |
| rclcpp::Publisher< sensor_msgs::msg::Range >::SharedPtr | m_TOFRearPubSPtr |
| rclcpp::Publisher< sensor_msgs::msg::Range >::SharedPtr | m_TOFRightPubSPtr |
| rclcpp::Publisher< std_msgs::msg::Float32 >::SharedPtr | m_velocityPubSPtr |
| rclcpp::Subscription< ControlMotionType >::SharedPtr | m_controlValuesSubSPtr = nullptr |
| Subscriber object for control values from controller node. More... | |
| rclcpp::Subscription< SettingsValuesType >::SharedPtr | m_settingsValuesSubSPtr = nullptr |
| Subscriber object for control values from controller node. More... | |
| rclcpp::Subscription< ControlLightsType >::SharedPtr | m_lightsSubSPtr = nullptr |
| std::shared_ptr< ECUHandler > | m_ecuHandlerSPtr = nullptr |
| Handler for ECU communication. More... | |
| ControlLightsType::SharedPtr | m_lastLightsSPtr = nullptr |
| uint8_t | m_lastButtonState = 0 |
| std::mutex | m_lightsMtx |
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 15 of file ECUNode.hpp.
|
inline |
Definition at line 17 of file ECUNode.hpp.
| void ECUNode::init | ( | std::shared_ptr< ECUHandler > | _handler | ) |
Initialises the ECUNode and saves the pointer to the ECU Handler.
| _handler | An ECU Handler object |
Definition at line 19 of file ECUNode.cpp.
References lights_callback(), galaxis::utils::log(), motion_callback(), and settingsvalues_callback().

|
private |
Definition at line 300 of file ECUNode.cpp.
Referenced by init().

|
private |
Callback function on new message. Sends the Data to the ECUHandler to send to the ECU.
| p_msgSPtr |
Definition at line 54 of file ECUNode.cpp.
References ComputerPacket, convertLightStatesIntoFinalState(), galaxis::utils::log(), and galaxis::utils::log_debug().
Referenced by init().


| void ECUNode::publishMeasurements | ( | const EcuPacket *const | packet, |
| const std::array< std::chrono::duration< double, std::milli >, 10 > & | diff_ms | ||
| ) |
Publishes the new Measurements from the ECU on the apropriate Publishers.
Definition at line 140 of file ECUNode.cpp.
References galaxis::motorSettings::erpmToVelocity(), galaxis::utils::log(), and galaxis::utils::log_warning().
Referenced by main().


|
private |
Callback function on new message. Sends the Data to the ECUHandler to send to the ECU.
| p_msgSPtr |
Definition at line 104 of file ECUNode.cpp.
References galaxis::utils::log(), and SettingsPacket.
Referenced by init().


|
private |
Publisher object for buttonStates.
Definition at line 40 of file ECUNode.hpp.
|
private |
Subscriber object for control values from controller node.
Definition at line 60 of file ECUNode.hpp.
|
private |
Handler for ECU communication.
Definition at line 73 of file ECUNode.hpp.
|
private |
Definition at line 77 of file ECUNode.hpp.
|
private |
Definition at line 75 of file ECUNode.hpp.
|
private |
Definition at line 79 of file ECUNode.hpp.
|
private |
Definition at line 69 of file ECUNode.hpp.
|
private |
Publisher object for measurements.
Definition at line 46 of file ECUNode.hpp.
|
private |
Subscriber object for control values from controller node.
Definition at line 66 of file ECUNode.hpp.
|
private |
Definition at line 51 of file ECUNode.hpp.
|
private |
Definition at line 52 of file ECUNode.hpp.
|
private |
Definition at line 53 of file ECUNode.hpp.