#include <GalaxisNode.hpp>
Definition at line 21 of file GalaxisNode.hpp.
◆ GalaxisNode() [1/3]
| GalaxisNode::GalaxisNode |
( |
| ) |
|
|
protecteddelete |
◆ GalaxisNode() [2/3]
| GalaxisNode::GalaxisNode |
( |
std::string |
p_name, |
|
|
unsigned int |
p_heartbeatTimePeriod |
|
) |
| |
|
protected |
◆ GalaxisNode() [3/3]
| GalaxisNode::GalaxisNode |
( |
std::string |
p_name | ) |
|
|
protected |
◆ create_parameters()
| void GalaxisNode::create_parameters |
( |
std::shared_ptr< json > |
configJsonSPtr | ) |
|
|
protected |
Definition at line 81 of file GalaxisNode.cpp.
82 log(
"[GALAXIS_NODE] Create ROS parameters from JSON.");
85 for (json::iterator itSubSec = configJsonSPtr->begin(); itSubSec != configJsonSPtr->end(); ++itSubSec) {
86 for (json::iterator itParam = itSubSec.value().begin(); itParam != itSubSec.value().end(); ++itParam) {
87 std::string fullParameterName = itSubSec.key() +
"." + itParam.key();
89 rcl_interfaces::msg::ParameterDescriptor paramDesc;
90 paramDesc.description = fullParameterName;
91 if(itParam.value().is_number_integer()) {
92 this->declare_parameter<int>(fullParameterName.c_str(), itParam.value(), paramDesc);
94 else if(itParam.value().is_number_float()) {
95 this->declare_parameter<double>(fullParameterName.c_str(), itParam.value(), paramDesc);
98 log_warning(
"[GALAXIS_NODE] Type of parameter ", fullParameterName,
" is NOT valid (INT or FLOAT/DOUBLE). Skipping.");
105 catch(
const std::exception& e) {
106 log_warning(
"[GALAXIS_NODE] Failed to create parameters!");
References galaxis::utils::log(), galaxis::utils::log_warning(), and m_rosParameterNamesVec.
Referenced by enable_parameters().
◆ enable_parameters()
| void GalaxisNode::enable_parameters |
( |
std::function< rcl_interfaces::msg::SetParametersResult(const std::vector< rclcpp::Parameter > &)> |
callbackFunc | ) |
|
|
protected |
◆ get_current_service_state()
◆ get_global_settings()
| json const & GalaxisNode::get_global_settings |
( |
| ) |
|
|
protected |
◆ register_callback()
◆ service_state_callback()
| void GalaxisNode::service_state_callback |
( |
ServiceStateType::SharedPtr const |
p_msgSPtr | ) |
|
|
protected |
Definition at line 33 of file GalaxisNode.cpp.
34 switch(p_msgSPtr->state) {
35 case ServiceStateType::STATE_BOOTSTRAP:
36 RCLCPP_INFO(this->get_logger(),
"galaxis::serviceStates::State: switch to BOOTSTRAP");
41 case ServiceStateType::STATE_FREE_DRIVING:
42 RCLCPP_INFO(this->get_logger(),
"galaxis::serviceStates::State: switch to FREE_DRIVING");
47 case ServiceStateType::STATE_OBSTACLE_DRIVING:
48 RCLCPP_INFO(this->get_logger(),
"galaxis::serviceStates::State: switch to OBSTACLE_DRIVING");
54 RCLCPP_ERROR(this->get_logger(),
"galaxis::serviceStates::State not implemented. %i",
m_serviceState);
References galaxis::serviceStates::BOOTSTRAP, galaxis::serviceStates::FREE_DRIVING, m_callback_service_state, m_heartbeatHandler, m_serviceState, galaxis::serviceStates::OBSTACLE_DRIVING, and galaxis::ROSHeartbeat::set_service_state().
Referenced by GalaxisNode().
◆ tickPub()
template<typename... Args>
◆ tickSub()
template<typename MsgSPtr >
| void GalaxisNode::tickSub |
( |
std::map< galaxis::serviceStates::State, std::function< void(const MsgSPtr)>> const * |
p_functionMapPtr, |
|
|
MsgSPtr const |
p_message |
|
) |
| |
|
inlineprotected |
◆ m_callback_service_state
◆ m_globalSettings
| json GalaxisNode::m_globalSettings |
|
private |
◆ m_heartbeatHandler
◆ m_nodeName
| std::string GalaxisNode::m_nodeName = "nodename_not_set" |
|
private |
◆ m_parameterCallbackHandle
| OnSetParametersCallbackHandle::SharedPtr GalaxisNode::m_parameterCallbackHandle |
|
private |
◆ m_rosParameterNamesVec
| std::vector<std::string> GalaxisNode::m_rosParameterNamesVec |
|
private |
◆ m_serviceState
◆ m_serviceSubscription
| rclcpp::Subscription<ServiceStateType>::SharedPtr GalaxisNode::m_serviceSubscription |
|
private |
◆ m_systemSettingsSubSPtr
The documentation for this class was generated from the following files: