Odometry PROS help

I am currently using the OkapiLib in my code. I have noticed that there is a significant pause/delay/gap between movements in the code. I also saw there was a TimeFactoryUtil method but I am not sure how to use it properly. The code below seems to have no effect

Adding logging may help (changing the log level to INFO or DEBUG as well):

https://okapilib.github.io/OkapiLib/md_docs_tutorials_concepts_logging.html

Documentation about the SettleUtil

https://okapilib.github.io/OkapiLib/md_docs_tutorials_concepts_settled-util.html

I think what you’ll actually want to do is replace :

.withOdometryTimeUtilFactory(factory)

with

.withOdometryTimeUtilFactory({50, 5, 5_ms})

Which implicitly uses the ConfigurableTimeUtilFactory class. The call to factory.withSettledUtilParams does not actually change the state of the factory, it just returns a TimeUtil

You may also want to test how this behaves without the PID and see if there are still delays between moves.

7 Likes

Sorry for the late response. I looked into what you said and tried replacing the code with what you have suggested and I am still getting this error.

. If you know how to fix this error please let me know. Thanks for your help!

remove the semicolon

2 Likes

That wasn’t the problem sadly. I removed it and it keeps saying there’s no matching constructor.

The line might not be able to use the {5,50,50_ms} syntactic sugar and may be:

withOdometryTimeUtilFactory(ConfigurableTimeUtilFactory(5,50,50_ms))

Probably don’t want the settle time to be below 10-20 milliseconds as I don’t think sensors update at that rate

3 Likes

Thanks so much, that seemed to do the trick editor wise. I will have to see what the effect is on the robot. I just had one last question, how would you use the logger like you described before?

The logger opens a couple of possibilities:

  1. You can insert a microusb card in the brain, and log output there. Downside is the ergonomics- put in card, have robot do stuff, take out card, open file from card on computer, debug
  2. Plug the computer into the brain via the micro USB port. Use Pros to run the program with an open terminal and watch the output as the robot does things.
  3. It sounds like last nights Pros release allows wireless terminal. I don’t know exactly what this means, but I think you would plug the joystick into the computer instead of the brain and the rest of 2 applies

Note - the configuration line of the debugger is different between 1 and 2-3. I think the config for 2 and 3 are the same.

I’m on my phone so hard to find exact links, but I think the OkapiLib and Pros documentation should be clear enough to figure this out

2 Likes