0
$\begingroup$

I am attempting to make the iRobot Create 2 drive in a straight line using the opcode 137 with the parameters specified in the OI documentation. "Straight = 32768 or 32767 = 0x8000 or 0x7FFF" I have tried both of these parameters, but the robot always veers to the right as it moves forward. I've verified that my byte order is correct.

Is this expected behavior or is there an issue with my unit? Is there a way to get the robot to drive straight? I've also tried the DriveDirect command with various speeds to the two motors with no luck there either. I've read a bit about PID control, but was hoping that was already implemented in the firmware since I've not done PID control before.

The platform that I'm using is a Raspberry PI running Windows 10 IoT Core and a .NET application. I've also tried from a direct serial connection on a Windows Desktop and an Arduino. All of these give me the same results.

$\endgroup$
0
$\begingroup$

I'm using a different controller but here is what I send for a forward command to drive straight

137,0,150,127,255

enter image description here

$\endgroup$
  • $\begingroup$ Thanks. This is what I've been using and it the robot veers to the right. $\endgroup$ – Stacy Oct 26 '18 at 13:06
0
$\begingroup$

Try aleternating 32768 between 32767, it worked for me.

Measure the time or distance of how long it stays straight using only 1 opcode.

Loop through the 2 different codes letting each opcode run less time or distance than it takes for it to start curving.

$\endgroup$
  • $\begingroup$ I'll give the alternating thing a try. I won't be able to try it until next week since the robot is at my office, but I'll be sure to post my results. $\endgroup$ – Stacy Oct 26 '18 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.