Hardware interface for seadragon motors

Dependencies:   mbed Servo ros_lib_kinetic

Files at this revision

API Documentation at this revision

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
--- 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;
     }