Class Controller

Class Documentation

class Controller

Default control law for approaching a dock target.

Public Functions

explicit Controller(const rclcpp_lifecycle::LifecycleNode::SharedPtr &node)

Create a controller instance. Configure ROS 2 parameters.

bool computeVelocityCommand(const geometry_msgs::msg::Pose &pose, geometry_msgs::msg::Twist &cmd, bool backward = false)

Compute a velocity command using control law.

Parameters:
  • pose – Target pose, in robot centric coordinates.

  • cmd – Command velocity.

  • backward – If true, robot will drive backwards to goal.

Returns:

True if command is valid, false otherwise.

rcl_interfaces::msg::SetParametersResult dynamicParametersCallback(std::vector<rclcpp::Parameter> parameters)

Callback executed when a parameter change is detected.

Parameters:

event – ParameterEvent message

Public Members

rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr dyn_params_handler_
std::mutex dynamic_params_lock_

Protected Attributes

std::unique_ptr<nav2_graceful_controller::SmoothControlLaw> control_law_
double k_phi_
double k_delta_
double beta_
double lambda_
double slowdown_radius_
double v_linear_min_
double v_linear_max_
double v_angular_max_