The package is an interlayer between the robot's navigation stack and actual hardware controllers. It computes separate velocities for wheels of a two-wheeled robot using command velocity and the known state of every wheel.
.
├── config
│ └── README.md
├── include
│ └── robotec_velocity_controller
│ └── robot_hardware.hpp
├── src
│ ├── controller_node.cpp
│ └── robot_hardware.cpp
├── CMakeLists.txt
├── LICENSE
├── package.xml
├── README.md
└── TODO.md
include
: RobotHWImplementation header filesrc
: node source code
CHANGELOG.md
: the file where the changes to the project are desribedREADME.md
: project documentationTODO.md
: suggesting changes in the package
Class hierarchy is represented as one class, which is an implementation of ros_control's interface.
The class is an implementation of the RobotHW class from ros_control package. The class is dedicated to create a filler between ros_control and robot's actual hardware.
controllerInitialization
: initialization of the controllers for ControllerManagerupdate
: read, calculate and write data on a time eventwrite
: the method is dedicated to publishing the data when triggered by the timer event(left/right)WheelDegreesCallback()
: callback for receiving degrees data(left/right)WheelvelocityCallback()
: callback for receiving velocity data
WHEELS_AMOUNT
: amount of joints to createleft_wheel_setpoint_pub
: desirable value of speed to achieve on the left wheelright_wheel_setpoint_pub
: desirable value of speed to achieve on the right wheel_state_interface
: interface for checking state of joints (ros_control)_velocity_interface
: velocity controller interface (ros_control)_positions
: array of positions_velocities
; array of velocities_efforts
: array of applied efforts_effort_commands
: array of efforts to handle joints control_velocity_commands
: array of velocity to handle joints control_rate
: timer trigger ratenh_
: ROS node instancetimer_event
: ROS timer instanceelapsed_time_
: elapsed time since last operationcontroller_manager_
: controller_manager instance
This node is an implementation of RobotHW class (ros_control), which is dedicated to be a middleman between high-level operations (e.g. data transferring) and actual joint controllers (ros_controllers). robotec_velocity_controller gets data of which speed it should maintain on two different wheels of differential drive robot. Then, using data about actual state of the wheels, it calculates velocities for them and publishes the data on timer triggers.
(left/right)/velocity
: topic with current velocity data(left/right)/degrees
: topic with current degrees data
(left/right)/setpoint
: topic with desirable valocity for every wheel separately
left_velocity
: name of the left wheel velocity data topic, default :/left_wheel/velocity
right_velocity
: name of the right wheel velocity data topic, default :/left_wheel/velocity
left_degrees
: name of the left wheel degrees data topic, default :/left_wheel/degrees
right_degrees
: name of the right wheel degrees data topic, default :/right_wheel/degrees
left_setpoint
: name of the left wheel setpoint data topic, default :/left_wheel/setpoint
right_setpoint
: name of the right wheel setpoint data topic, default :/right_wheel/setpoint
-
The first step of using the package is to create a configuration file. The process is described in config folder
-
Next, you should run the command :
$ rosrun robotec_velocity_controller velocity_controller