You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In REVLib C++, simulating a Spark using SparkFlexSim or SparkMaxSim results in no change to the reported position or velocity of the device.
Expected behavior
when the robot state in sim gui is set to enabled, the spark devices should gain a positive velocity and change position over time. Applied output, motor current and setpoint should also change.
Actual behavior
position, velocity, applied output and motor current all stay at zero. The setpoint does change as expected.
Screenshots
As a reference, this is what happens when the equivalent code in Java in simulated:
(A little strange that the velocity jumps at the beginning, but that seems like a different issue.)
The above java example uses this code:
Attempting to "bypass" the iterate() function and instead calling m_flexSim.SetVelocity() or m_flexSim.SetPosition() directly results in the same issue: no change to the device velocity in sim gui.
There is also no change to the various encoder devices in sim gui ("SPARK MAX [1] RELATIVE ENCODER", etc)
The text was updated successfully, but these errors were encountered:
Thanks for looking into the issue.
Interestingly, that is not the behavior I am seeing when running with constant numbers in iterate(). This is the simplest I can think to make it, and I still don't see any movement on the sim:
I can also bypass iterate() entirely by running SetVelocity() and SetPosition() and the sim still stays at all zero (except the setpoint, which does change to match any spark.Set() calls)
Describe the bug
In REVLib C++, simulating a Spark using SparkFlexSim or SparkMaxSim results in no change to the reported position or velocity of the device.
To Reproduce
Error is present when simulating this project: https://github.com/Liam-Stow/2025-spark-sim/blob/main/src/main/cpp/Robot.cpp
As a quick reference:
Expected behavior
when the robot state in sim gui is set to enabled, the spark devices should gain a positive velocity and change position over time. Applied output, motor current and setpoint should also change.
Actual behavior
position, velocity, applied output and motor current all stay at zero. The setpoint does change as expected.
Screenshots
As a reference, this is what happens when the equivalent code in Java in simulated:
(A little strange that the velocity jumps at the beginning, but that seems like a different issue.)
The above java example uses this code:
Desktop:
Additional context
The text was updated successfully, but these errors were encountered: