Hooking up the PS3 Joystick and getting some meaningful results on the screen was a lot easier than expected. I purchased a small USB Bluetooth dongle which worked with Ubuntu straight away, and hooking up the software to display the output from the joystick was easy.
Developing a ROS node to convert that output into ROS command messages was also very easy following the tutorial on ros.org; as was my first go at getting a ros launch file setup. Getting the joystick connected requires root privileges and I haven't worked out how to do that bit from within the launch file yet.
My PC (running ROS on Ubuntu) talks to the robot hardware via an Arduino Mega over a USB serial data link. Before switching to ROS I had developed my own serial protocol but
lately I have been using the rosserial library which makes writing the
Arduino end and the PC end pretty simple. Using this system I was easily able to have the PS3 joystick remotely
control the speed and direction of each drive wheel, and the pan and
tilt of the head.
The only issue I currently have is that the serial connection keeps on dropping out, and that appears to be a result of the serial link getting swamped with too much data. I have a ROS throttle node running on the PC to limit the rate at which messages are sent to the Arduino but I still haven't got this running properly. More investigation is required. I'll try slowing everything down further, and changing the baud rate. My main worry is that I have so far only implemented a small proportion of the features my Arduino will be handling, so have a lot more data I need to send.
I may need to delve into the rosserial messaging system and see how compact the serial data is - perhaps I'll need to modify the protocol. This is one of the big advantages of ROS over MRDS which I trialled earlier - the system is open-source, so while my C++ and Python skills are pretty basic I can at least look at the source code and potentially modify it.
No comments:
Post a Comment