rosserial bluetooth teensy problem

Status
Not open for further replies.

jordiguerrero

New member
Hello,

I'm trying to use rosserial with Teensy 3.5 through bluetooth.

My first step: change the serial port from Serial to Serial1.

I follow the thread:
https://answers.ros.org/question/19...he-arduino-side/?answer=295159#post-id-295159

It compiles with Arduino Mega board but no with Teensy 3.5 (or other Teensy boards)

----------

I use:
Ubuntu 16.04, Kinetic ros, Arduino 1.8.5
The Hello World example code:
http://wiki.ros.org/rosserial_arduino/Tutorials/Hello World

----------

I tried to ways:
1. Modify the line 73 in the code arduino.1.8.5/libraries/ros_lib/ArduinoHardware.h
Code:
      iostream = &Serial1;

2. Replace:
Code:
ros::NodeHandle nh;
with:
Code:
class NewHardware : public ArduinoHardware
{
  public:
  NewHardware():ArduinoHardware(&Serial1, 57600){};
};
ros::NodeHandle_<NewHardware>  nh;

----------

The error when I try to compile is:

Code:
.../arduino-1.8.5/libraries/ros_lib/ArduinoHardware.h:67:5: note:   no known conversion for argument 1 from 'HardwareSerial*' to 'usb_serial_class*'
no matching function for call to 'ArduinoHardware::ArduinoHardware(HardwareSerial*, int)'

----------

ArduinoHardware.h:
http://docs.ros.org/jade/api/rosserial_arduino/html/ArduinoHardware_8h_source.html

----------

Can anyone help me? Thank you in advance :)
 
From looking at the source code of ArduinoHardware.h, I see that all definitions for the Teensy 3.x and LC processors are there, but I don't see #define USE_TEENSY_HW_SERIAL in your sketch before you #include <ros.h> ...
 
O.M.G. ...
I'm very ashamed. It was a silly mistake :_(.
With your correction the code compiles. Let me check with my Bluetooth before I close the thread.

Thank you theremingenieur!
 
Status
Not open for further replies.
Back
Top