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$

2 Answers 2

1
$\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$
2
  • $\begingroup$ Thanks. This is what I've been using and it the robot veers to the right. $\endgroup$
    – Stacy
    Oct 26, 2018 at 13:06
  • $\begingroup$ What are you sending for the radius byes? $\endgroup$
    – NomadMaker
    Dec 19, 2019 at 6:21
1
$\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$
1
  • $\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, 2018 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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