service for transition graph (#555)
* service for transition graph * remove keys, transition id unique, label ambiguous * semicolon for macro call
This commit is contained in:
parent
bedb3ae361
commit
3353ffbb15
9 changed files with 250 additions and 168 deletions
|
@ -416,7 +416,7 @@ public:
|
|||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
trigger_transition(
|
||||
const Transition & transition, rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
const Transition & transition, LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -425,7 +425,7 @@ public:
|
|||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
trigger_transition(
|
||||
uint8_t transition_id, rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
uint8_t transition_id, LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -433,7 +433,7 @@ public:
|
|||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
configure(rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
configure(LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -441,7 +441,7 @@ public:
|
|||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
cleanup(rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
cleanup(LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -449,7 +449,7 @@ public:
|
|||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
activate(rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
activate(LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -457,7 +457,7 @@ public:
|
|||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
deactivate(rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
deactivate(LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
|
@ -465,31 +465,31 @@ public:
|
|||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
const State &
|
||||
shutdown(rcl_lifecycle_transition_key_t & cb_return_code);
|
||||
shutdown(LifecycleNodeInterface::CallbackReturn & cb_return_code);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_configure(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_configure(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_cleanup(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_cleanup(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_shutdown(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_shutdown(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_activate(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_activate(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_deactivate(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_deactivate(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
bool
|
||||
register_on_error(std::function<rcl_lifecycle_transition_key_t(const State &)> fcn);
|
||||
register_on_error(std::function<LifecycleNodeInterface::CallbackReturn(const State &)> fcn);
|
||||
|
||||
protected:
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
#ifndef RCLCPP_LIFECYCLE__NODE_INTERFACES__LIFECYCLE_NODE_INTERFACE_HPP_
|
||||
#define RCLCPP_LIFECYCLE__NODE_INTERFACES__LIFECYCLE_NODE_INTERFACE_HPP_
|
||||
|
||||
#include "rcl_lifecycle/data_types.h"
|
||||
#include "lifecycle_msgs/msg/transition.hpp"
|
||||
|
||||
#include "rcl_lifecycle/rcl_lifecycle.h"
|
||||
|
||||
#include "rclcpp_lifecycle/state.hpp"
|
||||
#include "rclcpp_lifecycle/visibility_control.h"
|
||||
|
@ -44,12 +46,19 @@ protected:
|
|||
LifecycleNodeInterface() {}
|
||||
|
||||
public:
|
||||
enum class CallbackReturn : uint8_t
|
||||
{
|
||||
SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS,
|
||||
FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE,
|
||||
ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR
|
||||
};
|
||||
|
||||
/// Callback function for configure transition
|
||||
/*
|
||||
* \return true by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_configure(const State & previous_state);
|
||||
|
||||
/// Callback function for cleanup transition
|
||||
|
@ -57,7 +66,7 @@ public:
|
|||
* \return true by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_cleanup(const State & previous_state);
|
||||
|
||||
/// Callback function for shutdown transition
|
||||
|
@ -65,7 +74,7 @@ public:
|
|||
* \return true by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_shutdown(const State & previous_state);
|
||||
|
||||
/// Callback function for activate transition
|
||||
|
@ -73,7 +82,7 @@ public:
|
|||
* \return true by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_activate(const State & previous_state);
|
||||
|
||||
/// Callback function for deactivate transition
|
||||
|
@ -81,7 +90,7 @@ public:
|
|||
* \return true by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_deactivate(const State & previous_state);
|
||||
|
||||
/// Callback function for errorneous transition
|
||||
|
@ -89,7 +98,7 @@ public:
|
|||
* \return false by default
|
||||
*/
|
||||
RCLCPP_LIFECYCLE_PUBLIC
|
||||
virtual rcl_lifecycle_transition_key_t
|
||||
virtual CallbackReturn
|
||||
on_error(const State & previous_state);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue