data from and towards MotionMind motorcontroller
Hi all,
Right now we are working on a robot that was controlled by LabView on Windows before. We are trying to get it working on Ubuntu 14.04 with ROS indigo. We've been working through the tutorials, and already got our logitech controller working with turtlesim. Afterwards, we tried to connect to our motorcontrollers to read and write new positions from and towards the wheel. But we are not able to get data from and write data to the motorcontrollers. Our setup: It is a four wheeled robot, with one Maxon RE25 motor for steering and one Maxon RE40 for driving for each wheel. Each motor is controlled by a MotionMind rev 2 from Solutions Cubed. The data from and towards the motorcontrollers goes through four COM-ports and comes per USB into the pc.
We've managed to find a driver ( https://searchcode.com/codesearch/vie... ) for these motorcontrollers, but we don't have a clue how to install this on Ubuntu. Besides, we tried to read the USB port, but this gave us no more information than "00 00 2C".
We guess it should be fairly simple to control this setup, but we think the lack of our knowledge in ROS is the problem.
Hence, here the question: How can we control this setup using ROS?
Edit:
We tried to translate the Player driver, what did not work out very well, since we can't find how the opaque driver works.
Therefore we tried to write our own program to manage a connection with the motorcontrollers. The communication protocol is setup as binary. We tried lots of options of serial.serial as in http://pyserial.sourceforge.net/pyser... , however we did not manage to communicate with the ports. The program written is as follows:
import time
import serial
ser = serial.Serial("/dev/ttyUSB1", baudrate=19200, timeout=1)
a = bytearray("00011010000000010000000100000000000000000000000000011100")
while True: #infinite loop
bytes_written = ser.write(a)
read_byte = ser.read()
print "read_byte:\t", read_byte
print "type:\t", type(read_byte)
print "len\t", len(read_byte)
Are we overlooking something?
@Sander: I've moved your update to your main question. Here on ROS Answers, we try to reserve Answers for actual answers. Discussion is in comments, but updates to the 'current state' of the original poster go into edits of the original question.
You'll have to be more specific than "we did not manage to communicate with the ports". Which errors did you get?
Also: I don't think the
bytearray
class works the way you use it. You typically use (hexa)decimal notation with it. It can work with octal notation, but I don't think you want that.