Results 1 to 8 of 8

Thread: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

  1. <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    Hello everyone,

    I'm trying to control a dynamixel ax-12a with the OpenCM9.04 board and I'm programming the board using the arduino IDE.

    I was using the Dynamixel Workbench library for commanding the servo and it was working just fine, but because I will need to use ROS in my project, I wanted to include it into my code already.

    I downloaded the rosserial library and included it into simple h_Position example (under the OpenCM9.04/Dynamixel Workbench examples ) like:

    ...
    #include <DynamixelWorkbench.h>
    #include <ros.h>
    ...


    but as soon as I included the <ros.h> I started getting the following error
    In file included from /home/dominik/Arduino/libraries/Rosserial_Arduino_Library/src/ros.h:39:0,
    from /tmp/arduino_modified_sketch_218835/h_Position.ino:20:
    /home/dominik/Arduino/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h: In constructor 'ArduinoHardware::ArduinoHardware()':
    /home/dominik/Arduino/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h:55:16: error: cannot convert 'USBSerial*' to 'HardwareSerial*' in assignment
    iostream = &Serial;

    and the code won't compile.

    Does anyone know, what is causing this error and how to work around it?

    Thanks in advance!

  2. #2

    Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    It looks like the ROS library is hard-coded to expect a "real" serial port, which is reasonable on old-school Arduinos, but not later ones like the Leonardo (or the Teensy 3, or the OpenCM 9.04)
    The easiest way to work around this is to change the declaration of "iostream" to be a "USBSerial*" in the ROS library implementation.
    That may or may not lead to downstream other problems. If it does, then you need to analyze what it really needs, and figure out how to provide that.

  3. #3

    Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    I agree with @jwatte,

    You might want to report this on the Robotis forum: http://en.robotis.com/service/forum.php

    Which my guess is that @willson up there will then suggest that you raise an issue up on Robotis Github,
    I am not sure which of their projects would be the best one, but probably one of:
    https://github.com/ROBOTIS-GIT/OpenCM9.04
    https://github.com/ROBOTIS-GIT/DynamixelSDK
    or one of their ROS projects.

    But my guess is any of them will do, as they probably get to the same people.

  4. Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    Thanks for the replies.

    I already raised an issue on the DynamixelWorkbench Github, but you're probably right, that the ROBOTIS forum and Github is a more
    appropriate place for this.

    thanks @jwatte for the suggestion, I will give it a shot.

  5. #5

    Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    I think the problem is in ROS code, not Dynamixel code. USBSerial is not (necessarily) a HardwareSerial.
    They might, for example, want to use Stream instead?
    This is the same in Teensy 3/4, btw: SerialUSB is a Stream but not a HardwareSerial.

    Then again, if they expect to set the baud rate or control flow control or something, then more surgery on the ROS code may be needed.

  6. #6

    Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    @Jwatte @domiinio -

    Jwatte - you are totally correct.

    However It probably should work for Teensy 3.x - I probably need to get a Pull request for T4...

    If you look at the section:
    https://github.com/ros-drivers/rosse...Hardware.h#L44

    I think Robotis needs to get in an equivalent section, like is in for Teensy, to define the USB class as well.
    Where it defines the hardware Serial class to be as mentioned and define the USBSerial class as well.

    Kurt

  7. Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    Yeah, @Jwatte you're probably right, that I'd need to dig into the ROS code a little more, I tried changing the declaration of 'iostream' (or at least I hope I was changing it right and in the right place ), but it didn't help.

    I raised an issue on the ROBOTIS OpenCM9.04 Github as @KurtEck suggested, so if anyone is interested in the development, see this link
    https://github.com/ROBOTIS-GIT/OpenCM9.04/issues/90.

    Thanks for showing interest

  8. #8

    Re: <DynamixelWorkbench.h> with <ros.h> problem on Arduino IDE

    Good luck: I put some comments up on the github issue, that I think they need to put in a section #elif
    for the __opencm904__ like is in for the Teensy 3.x boards to allow the USB port to be used.

    And while I am thinking about it, I may also look to add in the T4...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Arbotix ros of arduino code verification problem
    By zhayantian in forum Arbotix, Microcontrollers, Arduino
    Replies: 11
    Last Post: 11-28-2014, 03:00 PM
  2. Question(s) Problem with Arbotix Commander 2 communicating with Arduino uno via xbees
    By jerry7580 in forum Arbotix, Microcontrollers, Arduino
    Replies: 4
    Last Post: 08-02-2013, 02:07 AM
  3. ROS problem -> cv_bridge: problem transfering images between nodes
    By Median in forum ROS - Robot Operating System
    Replies: 0
    Last Post: 03-11-2013, 10:44 AM
  4. Question(s) Arduino and SC16A Problem
    By ROBOTMAN in forum Software and Programming
    Replies: 18
    Last Post: 03-19-2011, 09:50 PM
  5. Question(s) Wirelessly programing arduino problem
    By gallamine in forum Robotics General Discussion
    Replies: 0
    Last Post: 10-25-2010, 03:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •