8 using std::placeholders::_1;
11 Node(p_name), m_heartbeatHandler(static_cast<rclcpp::Node*>(this), p_name, p_heartbeatTimePeriod) {
23 catch (std::exception &e) {
24 log_warning(
"Failed to load Global System Settings!");
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);
76 if (result.successful ==
false) {
77 log_error(
"[GALAXIS_NODE] Can NOT enable parameter functionality. Reason:\n", result.reason);
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!");