Skip to content

Commit

Permalink
Add semicolons to all RCLCPP and RCUTILS macros. (#565)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored Oct 5, 2018
1 parent eb439dd commit b3cbf06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ NodeParameters::register_param_change_callback(ParametersCallbackFunction callba
{
if (parameters_callback_) {
RCUTILS_LOG_WARN("param_change_callback already registered, "
"overwriting previous callback")
"overwriting previous callback");
}
parameters_callback_ = callback;
}
18 changes: 9 additions & 9 deletions rclcpp_lifecycle/src/lifecycle_node_interface_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
{
if (rcl_lifecycle_state_machine_is_initialized(&state_machine_) != RCL_RET_OK) {
RCUTILS_LOG_ERROR("Unable to change state for state machine for %s: %s",
node_base_interface_->get_name(), rcl_get_error_string_safe())
node_base_interface_->get_name(), rcl_get_error_string_safe());
return RCL_RET_ERROR;
}

Expand All @@ -306,7 +306,7 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
&state_machine_, transition_id, publish_update) != RCL_RET_OK)
{
RCUTILS_LOG_ERROR("Unable to start transition %u from current state %s: %s",
transition_id, state_machine_.current_state->label, rcl_get_error_string_safe())
transition_id, state_machine_.current_state->label, rcl_get_error_string_safe());
return RCL_RET_ERROR;
}

Expand All @@ -317,30 +317,30 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
&state_machine_, cb_return_code, publish_update) != RCL_RET_OK)
{
RCUTILS_LOG_ERROR("Failed to finish transition %u. Current state is now: %s",
transition_id, state_machine_.current_state->label)
transition_id, state_machine_.current_state->label);
return RCL_RET_ERROR;
}

// error handling ?!
// TODO(karsten1987): iterate over possible ret value
if (cb_return_code == lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR) {
RCUTILS_LOG_WARN("Error occurred while doing error handling.")
RCUTILS_LOG_WARN("Error occurred while doing error handling.");
rcl_lifecycle_transition_key_t error_resolved = execute_callback(
state_machine_.current_state->id, initial_state);
if (error_resolved == lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS) {
// We call cleanup on the error state
if (rcl_lifecycle_trigger_transition(
&state_machine_, error_resolved, publish_update) != RCL_RET_OK)
{
RCUTILS_LOG_ERROR("Failed to call cleanup on error state")
RCUTILS_LOG_ERROR("Failed to call cleanup on error state");
return RCL_RET_ERROR;
}
} else {
// We call shutdown on the error state
if (rcl_lifecycle_trigger_transition(
&state_machine_, error_resolved, publish_update) != RCL_RET_OK)
{
RCUTILS_LOG_ERROR("Failed to call cleanup on error state")
RCUTILS_LOG_ERROR("Failed to call cleanup on error state");
return RCL_RET_ERROR;
}
}
Expand All @@ -364,11 +364,11 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
try {
cb_success = callback(State(previous_state));
} catch (const std::exception &) {
// TODO(karsten1987): Windows CI doens't let me print the msg here
// TODO(karsten1987): Windows CI doesn't let me print the msg here
// the todo is to forward the exception to the on_error callback
// RCUTILS_LOG_ERROR("Caught exception in callback for transition %d\n",
// it->first)
// RCUTILS_LOG_ERROR("Original error msg: %s\n", e.what())
// it->first);
// RCUTILS_LOG_ERROR("Original error msg: %s\n", e.what());
// maybe directly go for error handling here
// and pass exception along with it
cb_success = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR;
Expand Down

0 comments on commit b3cbf06

Please sign in to comment.