Hello everybody. Firstly, i wanna say sorry for my English. I have several questions and hope that you will help me.
Not so far ago, we had a competition in Moscow and faced with a big problem.
The field was freezing and lagging ( you press the button or stick , and after many seconds robot starts mooving). The main judge said, that it is our problem because our Teleop programms are not multithreads. But when we had a competition in our region with a simple D-link router, everything was fine.
Now i’m afraid , that in the nearest competition in Moscow we will have that problem again .That’ s why , i’m not so sure that he is right about multitasking?
And 1 question more.
With a d-link router our robot were disconnected from the field seems that power supply were switching off time to time. Could it be because of static electricity? (Cuz we were always shocked by it , when were touching it)
Lagging and disconnects are most common when operating in a noisy environment. You want to use the recommended router for the FCS. You also want to set it to run on the channel with the least interference. Scan the area. You want to try to shut down any other wi-fi networks in the vicinity if possible. I would also avoid wireless mikes - we have been able to demonstrate interference between some microphones and the robots. You also want to disable bluetooth on the NXT.
Also, some computers have problems with the FCS, so it might be worthwhile trying one or two.
Just a few suggestions from a long-time FTA.
Sorry,
I didn’t answer your primary question. Single-thread teleop code works just fine in competition. There are soem things to check if you are having laggin issues in practice as well as with a competition field. Specifically, look for wait commands in the code. In teleop, you rarely need them and they can introduce lag. Also, if you connected to the robot via bluetooth, then connected tothe FCS, the robot will lag. At competition, use a cable to adjust the programming and leave bluetooth turned off on the NXT.
Thank you very much for information. But i don’t really know what to do(
In Moscow they Have Linksys router and it is lagging. My simple d-link isn’t lagging at all. And judge always saying that it is our fault of the code.
If i argue with the judge , i will be punished So thanks anyway.
If you send a copy of your RobotC teleop code, I can take a look through it for any red flags that might be responsible for some lag.
I have been to over 40 events with Samantha and the single-thread code is used at most of them. There are only a few teams that use multi-threaded code, usually for background tasks like monitoring for magnetic batons. The lagging tends to be specific to the location, FCS, and router, not the code. There are some exceptions that can creep into the code (rogue wait statements). A sure way to introduce lag is to connect via bluetooth and not fully disconnect before connecting to the FCS (I prefer my team to disable bluetooth, then power cycle the NXT and Samantha). We also tell the teams to turn off the robot after each match. Last year, we saw lagging issues if you went to multiple matches without power-cycling. Last year we also saw issues if teams had logos for the FCS to display. It took too much bandwidth uploading them.
Hope those suggestions help.
Multithreading is not required for lag free control. If you have
a problem with lag it’s either elsewhere in your software, or
in the FCS. It’s not inherently because your software is single
threaded.