Odrive and Touchdesigner?

Hey everyone!

Does someone here have some experience with touchdesigner099 and the odrive? As touchdesigner is based on python they should be fairly compatible?

I am planning on using a Kinect to detect motion and making a robotic arm move accordingly. Touchdesigner seems like a decent tool, especially since it has a very nice implementation of the Kinect!

Any thoughts?

One thing you may want to explore is using a Serial DAT node to directly communicate with the ODrive board using the Ascii protocol: https://docs.odriverobotics.com/ascii-protocol.html

Iā€™ve used the Serial DAT to communicate with Arduinos and with other motor controller boards before in Touchdesigner.

So this is more of a low-level protocol which bypasses the need to use Python.

If you want to use Python take a look at the demo in the library:

Nice!
Yes I work with touchdesigner and Arduino quite a lot as well and was hoping i could make it work similarly.

How would I format the sent out text DAT though? Iā€™m planning on just sending out motor positions in a certain order and will probably just preconfigure them in a table DAT.
Iā€™ve preconfigured it like this:
145

Would my sent out serial be just something like this?
op(ā€˜serial1ā€™).send(ā€œp 1 50 *42 \nā€)
I mean obviously not like just that because that doesnt seem to work. :rofl:

Except for setting the Odrive up as a serial port, are there other preconfigurations Iā€™ve got to make to make this work?

Iā€™m an idiot.
The correct code would be :
op(ā€˜serial1ā€™).send(ā€œmy Valuesā€, terminator="\n")

To send it to a serial DAT. Works great for basic position control and the likes! Works great if you want to store a bunch of data and send it out when triggered.

2 Likes

Hey Terry have you had any success? I started to have success with controlling the motor, but now nothing. I think odrive may have gone into a error mode. Is there a list of the ascii commands, such as how to clear errors and/or how to run calibration and set closed loop control?

here is what I am using in the CHOPEXEC DAT attached to my slider:

def valueChange(channel, sampleIndex, val, prev):
	#sends the value of the slider to the serial dats send method
	command = 't 1 ' + str(int(val))
	op('serial2').send(command,  terminator='\n')
	return
1 Like

Here are some more insights:

full calibration:
op('odrive_serial').send('w axis1.requested_state 8', terminator='\n')
closed loop:
op(ā€˜odrive_serialā€™).send(ā€˜w axis1.requested_state 3ā€™, terminator=ā€™\nā€™)
reboot odrive:
op(ā€˜odrive_serialā€™).send(ā€˜sbā€™, terminator=ā€™\nā€™)

I could put together a little TD toe file if you are interested, I created little button based interface that lets me reboot the odrive, reconnect over serial and rezero & calibrate.

1 Like

Hey Tom!
Just finished my bachelor thesis a couple of days ago- didnā€™t find the time to answer earlier!

To be honest I cheated a little- I set up the Odrive entirely through Anaconda and left it running for easy debugging, because Iā€™ve found the TouchDesigner/Ascii code caused errors more regularly (maybe also because Ive used four different serial outs as well as a Kinect as input, oops!) and I like still keeping Anacondas running for realtime debugging.

Youā€™ve gotten way further than I have yet :wink: Would be super cool to see how you managed!

1 Like