How exactly is the PWM output of the PolynomialThrusterCurveController consumed by a hardware interface? #66
-
I am aware that it is the [ardusub_manager] controller manager that handles taking in the robot_description and the .yaml config files in order to setup the appropriate controllers and hardware interfaces. I've checked "thruster_hardware.cpp" in the [ardusub_driver] package, however, it isn't clear to me where and how exactly the output command of the [PolynomialThrusterCurveController] which is a pwm (of type double) is consumed in the control system. Is there another package/controller that handles the pwm? Also, I'm curious why the pwm is converted into an int in "polynomial_thrust_curve_controller.cpp" considering its command interface is declared as a double. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The thruster hardware interface that you mentioned receives PWM commands and forwards these commands to ArduSub via MAVROS. Here is the relevant method. If you aren't using ArduSub and have direct control over the thrusters, you could implement an alternative hardware interface that directly applies the PWM commands. The PWM is converted into an int here so that the hardware interface doesn't need to make any decisions regarding how to post-process the command. Functionally, this implementation achieves the same result as converting it into an int in the hardware interface; however, leaving the fractional part of the command may be confusing to users who expect to receive an int. With regards to the ardusub_manager, this is a generic, legacy node meant to provide some endpoints for tasks that we often did with MAVROS. It does not interact with the control framework. I don't actually use that node in our current hardware deployments. |
Beta Was this translation helpful? Give feedback.
The thruster hardware interface that you mentioned receives PWM commands and forwards these commands to ArduSub via MAVROS. Here is the relevant method. If you aren't using ArduSub and have direct control over the thrusters, you could implement an alternative hardware interface that directly applies the PWM commands.
The PWM is converted into an int here so that the hardware interface doesn't need to make any decisions regarding how to post-process the command. Functionally, this implementation achieves the same result as converting it into an int in the hardware interface; however, leaving the fractional part of the command may be confusing to users who expect to receive an int.
With reg…