Class GimbalModule

Inheritance Relationships

Base Type

  • public rclcpp_lifecycle::LifecycleNode

Class Documentation

class psdk_ros2::GimbalModule : public rclcpp_lifecycle::LifecycleNode

Public Functions

explicit GimbalModule(const std::string &name)

Construct a new GimbalModule object.

Parameters

node_name – Name of the node

~GimbalModule()

Destroy the GimbalModule object.

CallbackReturn on_configure(const rclcpp_lifecycle::State &state)

Configures the GimbalModule. Creates the ROS 2 subscribers and services.

Parameters

state – rclcpp_lifecycle::State. Current state of the node.

Returns

CallbackReturn SUCCESS or FAILURE

CallbackReturn on_activate(const rclcpp_lifecycle::State &state)

Activates the GimbalModule.

Parameters

state – rclcpp_lifecycle::State. Current state of the node.

Returns

CallbackReturn SUCCESS or FAILURE

CallbackReturn on_cleanup(const rclcpp_lifecycle::State &state)

Cleans the GimbalModule. Resets the ROS 2 subscribers and services.

Parameters

state – rclcpp_lifecycle::State. Current state of the node.

Returns

CallbackReturn SUCCESS or FAILURE

CallbackReturn on_deactivate(const rclcpp_lifecycle::State &state)

Deactivates the GimbalModule.

Parameters

state – rclcpp_lifecycle::State. Current state of the node.

Returns

CallbackReturn SUCCESS or FAILURE

CallbackReturn on_shutdown(const rclcpp_lifecycle::State &state)

Shuts down the GimbalModule.

Parameters

state – rclcpp_lifecycle::State. Current state of the node.

Returns

CallbackReturn SUCCESS or FAILURE

bool init()

Initialize the GimbalModule.

Returns

true/false

bool deinit()

Deinitialize the GimbalModule.

Returns

true/false

Private Functions

void gimbal_rotation_cb(const psdk_interfaces::msg::GimbalRotation::SharedPtr msg)

Callback function to control roll, pitch, yaw and time.

Parameters

msg – psdk_interfaces::msg::GimbalRotation. Rotation mode allows to set incremental, absolute or speed mode command.(see T_DjiGimbalManagerRotation for more information).

void gimbal_set_mode_cb(const std::shared_ptr<GimbalSetMode::Request> request, const std::shared_ptr<GimbalSetMode::Response> response)

Set gimbal mode.

Parameters
  • request – GimbalSetMode service request. The camera mounted position for which the request is made needs to be specified as well as the desired gimbal mode. (see enum E_DjiGimbalMode for more information).

  • response – GimbalSetMode service response.

void gimbal_reset_cb(const std::shared_ptr<GimbalReset::Request> request, const std::shared_ptr<GimbalReset::Response> response)

Reset gimbal orientation to neutral point.

Parameters
  • request – GimbalSetMode service request. The camera mounted position for which the request is made needs to be specified as well as the desired gimbal mode. (see enum E_DjiGimbalMode for more information).

  • response – GimbalSetMode service response.