Class ControllerServer
- Defined in File controller_server.hpp 
Inheritance Relationships
Base Type
- public nav2_util::LifecycleNode
Class Documentation
- This class hosts variety of plugins of different algorithms to complete control tasks from the exposed FollowPath action server. - Public Types - Public Functions - Constructor for nav2_controller::ControllerServer. - Parameters:
- options – Additional options to control creation of the node. 
 
 - Destructor for nav2_controller::ControllerServer. 
 - Protected Types - Protected Functions - Configures controller parameters and member variables. - Configures controller plugin and costmap; Initialize odom subscriber, velocity publisher and follow path action server. - Parameters:
- state – LifeCycle Node’s state 
- Throws:
- pluginlib::PluginlibException – When failed to initialize controller plugin 
- Returns:
- Success or Failure 
 
 - Activates member variables. - Activates controller, costmap, velocity publisher and follow path action server - Parameters:
- state – LifeCycle Node’s state 
- Returns:
- Success or Failure 
 
 - Deactivates member variables. - Deactivates follow path action server, controller, costmap and velocity publisher. Before calling deactivate state, velocity is being set to zero. - Parameters:
- state – LifeCycle Node’s state 
- Returns:
- Success or Failure 
 
 - Calls clean up states and resets member variables. - Controller and costmap clean up state is called, and resets rest of the variables - Parameters:
- state – LifeCycle Node’s state 
- Returns:
- Success or Failure 
 
 - Called when in Shutdown state. - Parameters:
- state – LifeCycle Node’s state 
- Returns:
- Success or Failure 
 
 - FollowPath action server callback. Handles action server updates and spins server until goal is reached. - Provides global path to controller received from action client. Twist velocities for the robot are calculated and published using controller at the specified rate till the goal is reached. - Throws:
- nav2_core::PlannerException – 
 
 - Find the valid controller ID name for the given request. - Parameters:
- c_name – The requested controller name 
- name – Reference to the name to use for control if any valid available 
 
- Returns:
- bool Whether it found a valid controller to use 
 
 - Find the valid goal checker ID name for the specified parameter. - Parameters:
- c_name – The goal checker name 
- name – Reference to the name to use for goal checking if any valid available 
 
- Returns:
- bool Whether it found a valid goal checker to use 
 
 - Find the valid progress checker ID name for the specified parameter. - Parameters:
- c_name – The progress checker name 
- name – Reference to the name to use for progress checking if any valid available 
 
- Returns:
- bool Whether it found a valid progress checker to use 
 
 - Assigns path to controller. - Parameters:
- path – Path received from action server 
 
 - Calculates velocity and publishes to “cmd_vel” topic. 
 - Calls setPlannerPath method with an updated path received from action server. 
 - Calls velocity publisher to publish the velocity on “cmd_vel” topic. - Parameters:
- velocity – Twist velocity to be published 
 
 - Calls velocity publisher to publish zero velocity. 
 - Checks if goal is reached. - Returns:
- true or false 
 
 - Obtain current pose of the robot. - Parameters:
- pose – To store current pose of the robot 
- Returns:
- true if able to obtain current pose of the robot, else false 
 
 - get the thresholded velocity - Parameters:
- velocity – The current velocity from odometry 
- threshold – The minimum velocity to return non-zero 
 
- Returns:
- double velocity value 
 
 - get the thresholded Twist - Parameters:
- Twist – The current Twist from odometry 
- Returns:
- Twist Twist after thresholds applied 
 
 - Callback executed when a parameter change is detected. - Parameters:
- event – ParameterEvent message 
 
 - Protected Attributes