Tagged: Arduino, controller, program, programming, XBox
This topic has 2 replies, 1 voice, and was last updated 8 years, 9 months ago by SuperDroid.
- AuthorPosts
- March 16, 2016 at 5:48 pm #3320SuperDroidKeymaster
A customer wrote:
Hello,
I was asked to write a program that sends commands to the robot to make it move. This would be a ‘replacement’ to the XBox controller and software that came with the system. Is there a document that describes what commands the Ardunio system can accept?
I hope that it would accept something like “move 2 feet at 30 degrees” but I don’t think I will have it so easy.
Thanks for your help.
March 16, 2016 at 5:49 pm #3321SuperDroidKeymasterThe Arduino system only takes one packet type. If you look at the Arduino code we gave you, in the file WifiATRInterface.h you will see the packet structure (rxPacket). The relevant bytes in that packet for your robot are:
rxPacket.driveChar — forward/back movement
rxPacket.turnChar — rotation
rxPacket.panChar — left/right strafing
rxPacket.panHighChar — raise/lower scissor liftIt will not take commands to “move 2 feet at 30 degrees.” You would need to give it a mix of drive/turn/strafe to get it to move in the right direction and you could monitor the encoder pulses using the data in the return packet to figure out how far you’ve moved. The encoder data is returned for each wheel; these are the bytes called FR_a, FR_b, FR_c, etc. in the return packet. FR for front right wheel, FL for front left, RR for rear right, RL for rear left. The scissor lift encoder bytes are in there as well.
While running the WifiATR program on a PC, you can click Tools -> Debug Window to see the packets being exchanged between the PC program and the robot to help you in the development of your program.
March 16, 2016 at 5:50 pm #3322SuperDroidKeymasterThe customer replied:
Thank you. This is just what I needed to get started.
- AuthorPosts
You must be logged in to reply to this topic.