SpheroEDU and driveTo Command

Hi all,

I have been excited to use some of the drive to position commands that appear to now be available in the SDK after the update in August. I built my own control algorithms to do this within SpheroEDU app, but I’m sure the Sphero engineers did a better job than my hacky implementation :slightly_smiling_face:

I can’t find any documentation for accessing the new features within the SpheroEDU app. Are the new commands available there? I am using the newest update of the app on iOS.

This is THE most exciting feature that I’ve been waiting about since getting my RVR a year ago. Having the RVR reliably visit waypoints for pathfinding is a great demo of what it can do. I also know that having this available in the app would be a game changer for getting some of my math and science colleagues to use the RVR for their demos.

Thanks,
Evan

Hi everyone,

I realize now after looking through more posts that the new commands are only reflected in the Raspberry Pi SDK. The micro:bit SDK is still the single file with RVRPower, RVRDrive, and RVRLed.

I took some time looking through the files in the Pi SDK, and the functionality is there. The enums, drive, and other files show how things fit together. It looks like the need is for a lightweight version of the send_command function inside SerialAsyncDal class to take advantage of the new commands. Maybe we could then add the new commands piecewise into the micro:bit sphero.py file as needed.

I tried assembling an array of bytes and sending it in a method connected to RVRDrive like this:
@staticmethod
def drive_to_position_si(angle, x, y, speed):
#device_id drive = 0x16
#drive_to_position_si = 0x38
#sequence = 0x00
#target = 1 for nordic
#timeout = 5 seconds
command_data = [0x16,0x38,0x00,0x02,0x05,angle,x,y,speed]
uart.write(bytearray(command_data))
return

(Sorry, this isn’t formatting correctly as code)

This is the same format as the other commands in the class.

I then ran this on the micro:bit inside of a loop:
RVRDrive.drive_to_position_si(0x00,0x01,0x00,0x11)
The experts probably know that it doesn’t work. I do wonder if there is a way to do something like this though.

I really would love to have this functionality available without tacking on a Raspberry Pi…if it’s in the firmware already, I hope the commands in SpheroEDU aren’t far away.

Thanks for reading,

Evan

Hi @emwdx,

We do plan to include the drive to position commands in EDU eventually, but there are a lot of competing features on the roadmap so we haven’t gotten to it yet.

As for your micro:bit issue, you should definitely be able to get it working. It looks like you’re sending the 4 arguments as single bytes. They are IEEE 754 32-bit floating point values, so RVR will reject your packet with a bad data length error. Take a look through the lower layers of the Raspberry Pi SDK and you’ll find how we implemented the conversion from floats to a byte array for sending.

On a related note: The micro:bit SDK was pretty limited to start with due to the memory footprint of the MicroPython VM. We may be able to change that in the future, now that micro:bit has released a new board with a much more capable MCU.

Happy programming,
Jim

SPHERO Email Marketing -