#include <diff_drive_controller.h>

Classes | |
| struct | Commands |
| Velocity command related: More... | |
| struct | DynamicParams |
Public Member Functions | |
| DiffDriveController () | |
| bool | init (hardware_interface::VelocityJointInterface *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh) |
| Initialize controller. More... | |
| void | starting (const ros::Time &time) |
| Starts controller. More... | |
| void | stopping (const ros::Time &) |
| Stops controller. More... | |
| void | update (const ros::Time &time, const ros::Duration &period) |
| Updates controller, i.e. computes the odometry and sets the new velocity commands. More... | |
Public Member Functions inherited from controller_interface::Controller< hardware_interface::VelocityJointInterface > | |
| virtual bool | init (T *, ros::NodeHandle &) |
| virtual bool | init (T *, ros::NodeHandle &, ros::NodeHandle &) |
Public Member Functions inherited from controller_interface::ControllerBase | |
| virtual void | aborting (const ros::Time &) |
| virtual void | aborting (const ros::Time &) |
| bool | abortRequest (const ros::Time &time) |
| bool | abortRequest (const ros::Time &time) |
| ControllerBase ()=default | |
| ControllerBase (const ControllerBase &)=delete | |
| ControllerBase (ControllerBase &&)=delete | |
| bool | isAborted () const |
| bool | isAborted () const |
| bool | isInitialized () const |
| bool | isInitialized () const |
| bool | isRunning () const |
| bool | isRunning () const |
| bool | isStopped () const |
| bool | isStopped () const |
| bool | isWaiting () const |
| bool | isWaiting () const |
| ControllerBase & | operator= (const ControllerBase &)=delete |
| ControllerBase & | operator= (ControllerBase &&)=delete |
| bool | startRequest (const ros::Time &time) |
| bool | startRequest (const ros::Time &time) |
| bool | stopRequest (const ros::Time &time) |
| bool | stopRequest (const ros::Time &time) |
| void | updateRequest (const ros::Time &time, const ros::Duration &period) |
| void | updateRequest (const ros::Time &time, const ros::Duration &period) |
| virtual void | waiting (const ros::Time &) |
| virtual void | waiting (const ros::Time &) |
| bool | waitRequest (const ros::Time &time) |
| bool | waitRequest (const ros::Time &time) |
| virtual | ~ControllerBase ()=default |
Private Types | |
| typedef dynamic_reconfigure::Server< DiffDriveControllerConfig > | ReconfigureServer |
| Dynamic Reconfigure server. More... | |
Private Member Functions | |
| void | brake () |
| Brakes the wheels, i.e. sets the velocity to 0. More... | |
| void | cmdVelCallback (const geometry_msgs::Twist &command) |
| Velocity command callback. More... | |
| bool | getWheelNames (ros::NodeHandle &controller_nh, const std::string &wheel_param, std::vector< std::string > &wheel_names) |
| Get the wheel names from a wheel param. More... | |
| void | publishWheelData (const ros::Time &time, const ros::Duration &period, Commands &curr_cmd, double wheel_separation, double left_wheel_radius, double right_wheel_radius) |
| void | reconfCallback (DiffDriveControllerConfig &config, uint32_t) |
| Callback for dynamic_reconfigure server. More... | |
| bool | setOdomParamsFromUrdf (ros::NodeHandle &root_nh, const std::string &left_wheel_name, const std::string &right_wheel_name, bool lookup_wheel_separation, bool lookup_wheel_radius) |
| Sets odometry parameters from the URDF, i.e. the wheel radius and separation. More... | |
| void | setOdomPubFields (ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh) |
| Sets the odometry publishing fields. More... | |
| void | updateDynamicParams () |
| Update the dynamic parameters in the RT loop. More... | |
Additional Inherited Members | |
Public Types inherited from controller_interface::ControllerBase | |
| typedef std::vector< hardware_interface::InterfaceResources > | ClaimedResources |
Public Attributes inherited from controller_interface::ControllerBase | |
| ABORTED | |
| CONSTRUCTED | |
| INITIALIZED | |
| RUNNING | |
| enum controller_interface::ControllerBase:: { ... } | state_ |
| STOPPED | |
| WAITING | |
Protected Member Functions inherited from controller_interface::Controller< hardware_interface::VelocityJointInterface > | |
| std::string | getHardwareInterfaceType () const |
| bool | initRequest (hardware_interface::RobotHW *robot_hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh, ClaimedResources &claimed_resources) override |
This class makes some assumptions on the model of the robot:
Definition at line 68 of file diff_drive_controller.h.
|
private |
Dynamic Reconfigure server.
Definition at line 236 of file diff_drive_controller.h.
| diff_drive_controller::DiffDriveController::DiffDriveController | ( | ) |
Definition at line 146 of file diff_drive_controller.cpp.
|
private |
Brakes the wheels, i.e. sets the velocity to 0.
Definition at line 520 of file diff_drive_controller.cpp.
|
private |
Velocity command callback.
| command | Velocity command message (twist) |
Definition at line 530 of file diff_drive_controller.cpp.
|
private |
Get the wheel names from a wheel param.
| [in] | controller_nh | Controller node handler |
| [in] | wheel_param | Param name |
| [out] | wheel_names | Vector with the whel names |
Definition at line 565 of file diff_drive_controller.cpp.
| bool diff_drive_controller::DiffDriveController::init | ( | hardware_interface::VelocityJointInterface * | hw, |
| ros::NodeHandle & | root_nh, | ||
| ros::NodeHandle & | controller_nh | ||
| ) |
Initialize controller.
| hw | Velocity joint interface for the wheels |
| root_nh | Node handle at root namespace |
| controller_nh | Node handle inside the controller namespace |
Definition at line 165 of file diff_drive_controller.cpp.
|
private |
| time | Current time |
| period | Time since the last called to update |
| curr_cmd | Current velocity command |
| wheel_separation | wheel separation with multiplier |
| left_wheel_radius | left wheel radius with multiplier |
| right_wheel_radius | right wheel radius with multiplier |
Definition at line 763 of file diff_drive_controller.cpp.
|
private |
Callback for dynamic_reconfigure server.
| config | The config set from dynamic_reconfigure server |
| level | not used at this time. |
Definition at line 734 of file diff_drive_controller.cpp.
|
private |
Sets odometry parameters from the URDF, i.e. the wheel radius and separation.
| root_nh | Root node handle |
| left_wheel_name | Name of the left wheel joint |
| right_wheel_name | Name of the right wheel joint |
Definition at line 618 of file diff_drive_controller.cpp.
|
private |
Sets the odometry publishing fields.
| root_nh | Root node handle |
| controller_nh | Node handle inside the controller namespace |
Definition at line 687 of file diff_drive_controller.cpp.
|
virtual |
Starts controller.
| time | Current time |
Reimplemented from controller_interface::ControllerBase.
Definition at line 504 of file diff_drive_controller.cpp.
|
virtual |
Stops controller.
| time | Current time |
Reimplemented from controller_interface::ControllerBase.
Definition at line 515 of file diff_drive_controller.cpp.
|
virtual |
Updates controller, i.e. computes the odometry and sets the new velocity commands.
| time | Current time |
| period | Time since the last called to update |
Implements controller_interface::ControllerBase.
Definition at line 389 of file diff_drive_controller.cpp.
|
private |
Update the dynamic parameters in the RT loop.
Definition at line 750 of file diff_drive_controller.cpp.
|
private |
Whether to allow multiple publishers on cmd_vel topic or not:
Definition at line 165 of file diff_drive_controller.h.
|
private |
Frame to use for the robot base:
Definition at line 168 of file diff_drive_controller.h.
|
private |
Publish executed commands.
Definition at line 140 of file diff_drive_controller.h.
|
private |
Timeout to consider cmd_vel commands old:
Definition at line 162 of file diff_drive_controller.h.
|
private |
Definition at line 135 of file diff_drive_controller.h.
|
private |
Definition at line 136 of file diff_drive_controller.h.
|
private |
Controller state publisher.
Definition at line 148 of file diff_drive_controller.h.
|
private |
Definition at line 237 of file diff_drive_controller.h.
|
private |
Definition at line 238 of file diff_drive_controller.h.
|
private |
Definition at line 233 of file diff_drive_controller.h.
|
private |
Whether to publish odometry to tf or not:
Definition at line 174 of file diff_drive_controller.h.
|
private |
Definition at line 181 of file diff_drive_controller.h.
|
private |
Speed limiters:
Definition at line 180 of file diff_drive_controller.h.
|
private |
Definition at line 108 of file diff_drive_controller.h.
|
private |
Hardware handles:
Definition at line 112 of file diff_drive_controller.h.
|
private |
Definition at line 158 of file diff_drive_controller.h.
|
private |
Definition at line 183 of file diff_drive_controller.h.
|
private |
Definition at line 182 of file diff_drive_controller.h.
|
private |
Definition at line 104 of file diff_drive_controller.h.
|
private |
Frame to use for odometry and odom tf:
Definition at line 171 of file diff_drive_controller.h.
|
private |
Odometry related:
Definition at line 143 of file diff_drive_controller.h.
|
private |
Definition at line 145 of file diff_drive_controller.h.
|
private |
Definition at line 109 of file diff_drive_controller.h.
|
private |
Publish limited velocity:
Definition at line 186 of file diff_drive_controller.h.
|
private |
Odometry related:
Definition at line 107 of file diff_drive_controller.h.
|
private |
Publish wheel data:
Definition at line 189 of file diff_drive_controller.h.
|
private |
Definition at line 113 of file diff_drive_controller.h.
|
private |
Definition at line 159 of file diff_drive_controller.h.
|
private |
Definition at line 137 of file diff_drive_controller.h.
|
private |
Definition at line 144 of file diff_drive_controller.h.
|
private |
Definition at line 116 of file diff_drive_controller.h.
|
private |
Previous velocities from the encoders:
Definition at line 123 of file diff_drive_controller.h.
|
private |
Previous velocities from the encoders:
Definition at line 119 of file diff_drive_controller.h.
|
private |
Definition at line 124 of file diff_drive_controller.h.
|
private |
Definition at line 120 of file diff_drive_controller.h.
|
private |
Number of wheel joints:
Definition at line 177 of file diff_drive_controller.h.
|
private |
Wheel radius (assuming it's the same for the left and right wheels):
Definition at line 154 of file diff_drive_controller.h.
|
private |
Wheel separation, wrt the midpoint of the wheel width:
Definition at line 151 of file diff_drive_controller.h.
|
private |
Wheel separation and radius calibration multipliers:
Definition at line 157 of file diff_drive_controller.h.