<< return to Pixycam.com

Pixy2 turns wrong way in 3 way intersection

Hello, we use pixy2 for line tracking on heavy robot. Robot have to carry cargo and read qr codes. The competition will start after 2 day. Our problem is pixy2 goes wrong way (out of line) in 3 way intersection (t shape) we use setNextTurn(90) command depend on qr code we read before intersection. Its normal until intersection which we will turn left. We watch voltages of our motors and it should be left motor 0.003-1… and right motor 0.07-9… but its othervise. When we stop robot and set the line right of pixy2 its get perfect but when the line at left of pixy2 it is as I said. It is impossible to ride robot that straight because it is too big. Here’s the parkour image

We start at Q18 and from Q18 to Q22 these qr codes say setNextTurn(0), Q24 and Q25 say setNextTurn(90). but the robot goes right as I said. We watched at pixy Mun but it never show right vector. We just see intersection and a vector that goes true way! We have limited time. If you’ll help today we will be too much happy. Sorry for bad grammar and thanks.

Hello,
Keep in mind that setNextTurn() just sets which “branch” will be chosen at as the “Vector” in the next intersection. Your robot turning right might have to do with how you are controlling the motors – your robot turns right because the motors were commanded to turn right. Is this something that happens often? If so, you should try to debug by either looking at what’s happening in PixyMon, or printing what happens during the turn sequence. In particular, when is the intersection detected, and what the intersection’s lines are (their angles). Followed by the Vector (is the correct Vector chosen from the intersection.)

If you are having trouble with intersection detection (for example, perhaps Pixy is reporting intersections when it should not), you should increase the “Intersection filtering” parameter to 2 or 3:

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixymon_index#line-tracking-expert-tab

Edward

Thanks for reply. We solved the problem. The soluiton is pretty confused. We use pixy2 on aurduino but we control motors with roborio. The communication between aurduino and roborio is all about 2 voltage cable which sends voltage of virtual motors. Source of the problem is the turning code in the libary of pixy2 on arduino. It was, if you want to turn stop, go little back while turning opposite way (if turn left its right) then turn true way. But the back motor voltage when down vector comes, we didnt use any cable for that because we thought we dont need them. Also why that libary turn like that? Do we use pixy2 on truck? And the video of that libary have a little robot looks like arduino deafult robot chassis.

Hello,
I’m having trouble understanding your question. I think it’s a translation issue.

Edward