Class PendulumController
Defined in File pendulum_controller.hpp
Class Documentation
-
class PendulumController
Provides a simple PID controller for the inverted pendulum.
Public Functions
-
inline PendulumController(std::chrono::nanoseconds period, PIDProperties pid)
Default constructor.
- Parameters:
period – [in] The update period of the controller.
pid – [in] The properties of the controller.
Calculate new command based on new sensor state and PID controller properties.
Callback when a pendulum JointCommand message is received.
-
inline const pendulum_msgs::msg::JointCommand &get_next_command_message() const
Retrieve the command calculated from the last sensor message.
-
inline bool next_message_ready() const
True if the command message has been initialized.
-
inline std::chrono::nanoseconds get_publish_period() const
Get the update period of the controller.
-
inline void set_pid_properties(const PIDProperties &properties)
Set the properties of the PID controller (gains and desired output).
-
inline const PIDProperties &get_pid_properties() const
Get the properties of the controller.
-
inline void set_command(double command)
Set the commanded position of the controller.
-
inline double get_command() const
Get the commanded position of the controller.
Public Members
-
size_t messages_received = 0
Count the number of messages received (number of times the callback fired).
-
inline PendulumController(std::chrono::nanoseconds period, PIDProperties pid)