Internet issues causes robot to run differently

When I use the same settings for velocity and wait seconds, the robot runs differently if I my internet slows down shortly. How can I prevent this?

This is my code on IQ C05. Sometimes, it runs perfectly, sometimes it goes off the board, and sometimes it hits the blocks. It is different almost every time:

import vex
import drivetrain
import smartdrive
import vision
import sys

#region config
brain = vex.Brain()
motor_left = vex.Motor(vex.Ports.PORT1)
gyro_4 = vex.Gyro(vex.Ports.PORT4)
motor_right = vex.Motor(vex.Ports.PORT6, True) # Reverse Polarity
dt = smartdrive.Smartdrive(motor_left, motor_right, gyro_4, 200, 196, vex.DistanceUnits.MM, 1)
#endregion config

main thread

motor_left.spin(vex.REVERSE, 43, vex.PERCENT)
motor_right.spin(vex.REVERSE, 80, vex.PERCENT)
vex.wait(3.6,vex.SECONDS)
motor_left.spin(vex.REVERSE, 80, vex.PERCENT)
motor_right.spin(vex.REVERSE, 80, vex.PERCENT)
vex.wait(1.8,vex.SECONDS)
motor_left.spin(vex.REVERSE, 80, vex.PERCENT)
motor_right.spin(vex.REVERSE, 41, vex.PERCENT)
vex.wait(7,vex.SECONDS)
motor_left.spin(vex.REVERSE, 80, vex.PERCENT)
motor_right.spin(vex.REVERSE, 80, vex.PERCENT)
vex.wait(1.8,vex.SECONDS)

I believe that the slowness and inconsistencies that you are experiencing are caused by your machine being overworked, rather than internet bandwidth. At least that’s what happens for me. My machine is a few years old, and when I run a mimic it will begin to slow down and then the fan will kick on. However, once the project is running I can turn off my internet connection, and the project will continue to run. I doesn’t seem to need the internet once it has compiled.

To get more consistent results, let your machine rest between runs. If you know how to monitor CPU and GPU usage, then wait until usages of those resources go down before running the mimic again. It would also be helpful to close other apps that you don’t need while running the mimic.

1 Like

Yes, this is correct.

The quality of the Mimic (simulation) has more to do with the computer that you are using than the speed of your internet connect.

Try to avoid running multiple Robot Mesh Studio Mimic projects at once.

You may wish to close other open applications.

We have some ideas on things we can do to optimize the simulation so that it runs nicely on cheaper / older computers.

Unfortunately, this will occur in a future release.

Is it possible to implement buffering in future releases to help with this issue?

Buffering will solve problems with the transmission of data (for example model files).

The issue here is how the physics engine is performing the software simulation.

The more realistic the simulation the more computationally complex it is for your PC hardware.

There are some optimizations we are looking at to strike a balance between performance (speed) and realism such that the Mimics will run on lower end hardware (for example Chromebooks).

Many of these optimizations will happen in the near future (next several months).

The short term workaround is to be mindful of the number of other programs that you are running alongside Robot Mesh Studio, as they will compete for your computer’s hardware resources (memory and processing power).

Alternatively, find a faster computer.

We are sorry for your trouble with using our product and have a roadmap for correcting some of these issues.

As we make improvements to the software simulation in Robot Mesh Studio we will post announcements to this forum.

I can appreciate that some of the more elaborate challenges in later Virtual Academy exercises would run slowly on some computers because there is more things (game elements, etc.) for the physics engine to keep track of.

Upon further review, it turns out that the slowness; comes not from the internet but our own debugger.

The ‘step through’ highlighting functionality added a performance penalty that magnified when there was a loop / ‘repeat’ block. For example, a distance sensor repeatedly checks to see if it is within some threshold value.

We have since corrected for this in our code.

If it is still a problem you can shift the ‘debug slider’ to ‘Fast’ and everything should work.

faster