VNH ROSSERIAL PUB+SUB

Dependencies:   Motordriver QEI mbed ros_lib_kinetic

Fork of Test by SBD Digital Accelerator Robotics

Revision:
1:5f2cb6bc0a8e
Parent:
0:99538487421b
Child:
2:82249618b6bc
--- a/main.cpp	Fri Jul 13 19:58:04 2018 +0000
+++ b/main.cpp	Fri Jul 13 20:35:51 2018 +0000
@@ -11,12 +11,12 @@
 
 void messageCb( const geometry_msgs::Vector3& msg)
 {
-      while (true) {
-      for (float s=-msg.x; s < msg.x ; s += 0.01f) {
-       motorLeft.speed(s);
-       motorRight.speed(s);
-       wait(0.005);}
-    }
+      //while (true) {
+      //for (float s=-msg.x; s < msg.x ; s += 0.01f) {
+       motorLeft.speed(msg.x);
+       motorRight.speed(msg.y);
+      // wait(0.005);}
+   // }
 }
 
 ros::Subscriber<geometry_msgs::Vector3> sub("/motor/command", &messageCb );