This is a fork from the original, including a small change in the buffer size of the hardware interface (increased to 2048) and decreasing the number of publishers and subscribers to 5. Besides, the library about the message Adc.h was modified so as to increase the number of available Adc channels to be read ( from 6 to 7 ) For this modification, a change in checksum was required

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Files at this revision

API Documentation at this revision

Comitter:
jacobepfl1692
Date:
Tue Oct 17 18:49:03 2017 +0000
Parent:
1:a849bf78d77f
Commit message:
I increased the channels of the ADC to 6 (hence change in checksum) because my application needed it (STM32f407V6)

Changed in this revision

MbedHardware.h Show annotated file Show diff for this revision Revisions of this file
ros.h Show annotated file Show diff for this revision Revisions of this file
rosserial_mbed/Adc.h Show annotated file Show diff for this revision Revisions of this file
diff -r a849bf78d77f -r 9114cc24ddcf MbedHardware.h
--- a/MbedHardware.h	Sat Dec 31 00:59:58 2016 +0000
+++ b/MbedHardware.h	Tue Oct 17 18:49:03 2017 +0000
@@ -21,8 +21,9 @@
     }
 
     MbedHardware()
-      :iostream(USBTX, USBRX) {
-        baud_ = 57600;
+      //:iostream(USBTX, USBRX) {
+        :iostream(PA_2, PA_3) {  // Modification to be able to use USART2 from the STM32F407V6 connect PA2 to RXD and PA3 to TXD
+        baud_ = 57600; //! 57600
         t.start();
     }
 
diff -r a849bf78d77f -r 9114cc24ddcf ros.h
--- a/ros.h	Sat Dec 31 00:59:58 2016 +0000
+++ b/ros.h	Tue Oct 17 18:49:03 2017 +0000
@@ -40,7 +40,7 @@
 
 namespace ros
 {
-  typedef NodeHandle_<MbedHardware> NodeHandle;
+  typedef NodeHandle_<MbedHardware,5,5,2048,2048> NodeHandle;
 }
 
 #endif
diff -r a849bf78d77f -r 9114cc24ddcf rosserial_mbed/Adc.h
--- a/rosserial_mbed/Adc.h	Sat Dec 31 00:59:58 2016 +0000
+++ b/rosserial_mbed/Adc.h	Tue Oct 17 18:49:03 2017 +0000
@@ -1,11 +1,16 @@
 #ifndef _ROS_rosserial_mbed_Adc_h
 #define _ROS_rosserial_mbed_Adc_h
 
+/*
+MODIFIED BY JACOB : ADDED AN EXTRA ADC CHANNEL
+*/
+
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
 #include "ros/msg.h"
 
+
 namespace rosserial_mbed
 {
 
@@ -24,6 +29,8 @@
       _adc4_type adc4;
       typedef uint16_t _adc5_type;
       _adc5_type adc5;
+      typedef uint16_t _adc6_type;
+      _adc6_type adc6;
 
     Adc():
       adc0(0),
@@ -31,7 +38,8 @@
       adc2(0),
       adc3(0),
       adc4(0),
-      adc5(0)
+      adc5(0),
+      adc6(0)
     {
     }
 
@@ -56,6 +64,9 @@
       *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF;
       *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF;
       offset += sizeof(this->adc5);
+      *(outbuffer + offset + 0) = (this->adc6 >> (8 * 0)) & 0xFF;
+      *(outbuffer + offset + 1) = (this->adc6 >> (8 * 1)) & 0xFF;
+      offset += sizeof(this->adc6);
       return offset;
     }
 
@@ -80,11 +91,15 @@
       this->adc5 =  ((uint16_t) (*(inbuffer + offset)));
       this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
       offset += sizeof(this->adc5);
+      this->adc6 =  ((uint16_t) (*(inbuffer + offset)));
+      this->adc6 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
+      offset += sizeof(this->adc6);
      return offset;
     }
 
     const char * getType(){ return "rosserial_mbed/Adc"; };
-    const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; };
+    const char * getMD5(){ return "a1c93390d0a5d50b5be382174396ec0c"; };    
+    //const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; };
 
   };