I was very excited when I learned Rhys Mainwaring created ROS software for Curio rover, a sibling of my Sawppy rover. An autonomous Sawppy on ROS has always been the long-term goal but I have yet to invest the time necessary to climb the learning curve. Rhys has far more ROS experience, and I appreciated the opportunity to learn from looking over the Curio Github repository. Here are some of my notes. written with the imperfect accuracy and completeness of a ROS beginner learning as I go.
The most novel part of Curio is obtaining odometry data from LX-16A’s position sensor with the use of a filter that recognizes when we’re in the dead zone of that position sensor and rejects bad data. I believe Rhys has ambition to extrapolate position data while within the dead zone but I didn’t find the code to make it happen. Either I missed it or that is still yet to come.
I love the goal of odometry calculation without requiring additional hardware, but Rhys ran into problems with bandwidth and a little extra hardware was brought in to help as (hopefully?) a short term workaround. While Sawppy didn’t need to communicate with the servos very frequently, Curio needed to also poll servo positions far more frequently for the odometry filter. Rhys found that the LewanSoul BusLinker board’s serial to USB bridge could not sustain the data rate necessary for the filter to obtain good data.
As a workaround, Curio makes use of an Arduino Mega 2560 to communicate with BusLinker via its 5V UART TX/RX pins, and then translating that to USB serial for the Raspberry Pi. The Arduino Mega is necessary for this role because it has multiple hardware UART necessary to communicate with both BusLinker and Raspberry Pi at high speed. I only have Arduino Nano on hand, with a single UART, and thus unsuitable for the purpose.
Curio’s Arduino Mega also has a second job: that of interpreting PWM commands from a remote control receiver, relaying user commands from a remote control transmitter. This is an alternative to my HTML-based control scheme over WiFi.
Curio’s Arduino communicates with its Pi over USB serial, using the rosserial_arduino library. Rhys has set up Curio’s Arduino firmware code such that its two jobs can easily be separated. If a rover builder only wants one or the other function, it should be as easy as changing the values of
ENABLE_RADIO_CONTROL_DECODER to trigger the right
#ifdef to make it happen.
4 thoughts on “Notes on Exploring Curio ROS: Arduino Mega”
Having also appreciated ros_control, I was curious to see your note that it’s not in ROS 2. I haven’t even looked at ROS 2 yet, but there is ros2_control: https://index.ros.org/p/ros2_control/
You are correct for today’s status. However please note I wrote this in May 2020, which was before ros2_control 0.1.0 released on December 2020.
LikeLiked by 1 person
Please Roger, I need you help !!!
You have a photo of a sawppy project where you managed to operate lx16a servo by using only BusLinker 2.2 board. I have been trying for months to get the lx16a serial servo to work with just the buslinker board like you have in a photo but the photo does not show clearly which wires go where. How can I get a better wiring diagram that shows the wiring, and also the sketch for arduino board.
i tried going to gethub as you suggested, but all the branches, twists and turns of that site is way too confusing for me. Please help.
my email is below.
This post is about Curio. I did not build Curio, please contact Curio’s builder if you have Curio-specific questions.
For my Sawppy:
* Wiring diagram with Arduino is at the very bottom of https://github.com/Roger-random/Sawppy_Rover/blob/main/docs/README.md
* Arduino sketch is at https://github.com/Roger-random/Sawppy_Rover/tree/main/arduino_sawppy