![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Hardware interface for seadragon motors
Dependencies: mbed Servo ros_lib_kinetic
Revision 2:48a9c25e5d26, committed 2019-06-28
- Comitter:
- roger_wee
- Date:
- Fri Jun 28 19:58:04 2019 +0000
- Parent:
- 1:c7cfd52db721
- Commit message:
- Working 2019 thrusters
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c7cfd52db721 -r 48a9c25e5d26 main.cpp --- a/main.cpp Wed Aug 01 08:12:41 2018 +0000 +++ b/main.cpp Fri Jun 28 19:58:04 2019 +0000 @@ -75,17 +75,20 @@ // Forward thrust callback returns valules [0:150] void thrust_motor_callback( const std_msgs::Int16& msg) { + // Updates pwm values for forward thrust motors if (msg.data == 0) { + // Stop motors lthrustpwm = rthrustpwm = PWMBASELINE; } else if (msg.data < 0) { + // Go reverse lthrustpwm = PWMBASELINE - 25 + msg.data; rthrustpwm = PWMBASELINE - 25 + msg.data; } else{ - // Update yaw motor pwm + // Go forward lthrustpwm = PWMBASELINE + 25 + msg.data; rthrustpwm = PWMBASELINE + 25 + msg.data; }