Increase precision of simulate sensor plot y-axis by 1 digit.

- Before this change, the y-axis scale had only one digit, leading to user confusion. Small changes in senor values could appear as if the values remained at the nearest integer value, while in fact the y-axis itself was changing, but this was not evident in the GUI due to the reduced precision.
- Fixes #719.

PiperOrigin-RevId: 506841881
Change-Id: I583036bba389cef8d9ecf1c1bbcfb573ef2285e6
This commit is contained in:
Yuval Tassa
2023-02-03 01:47:38 -08:00
committed by Copybara-Service
parent e2691f58a5
commit bc0184d67e
+2 -3
View File
@@ -376,7 +376,7 @@ void sensorinit(mj::Simulate* sim) {
mju::strcpy_arr(figsensor.title, "Sensor data");
// y-tick nubmer format
mju::strcpy_arr(figsensor.yformat, "%.0f");
mju::strcpy_arr(figsensor.yformat, "%.1f");
// grid size
figsensor.gridsize[0] = 2;
@@ -435,8 +435,7 @@ void sensorupdate(mj::Simulate* sim) {
}
// update linepnt
figsensor.linepnt[lineid] = mjMIN(mjMAXLINEPNT-1,
figsensor.linepnt[lineid]+2*dim);
figsensor.linepnt[lineid] = mjMIN(mjMAXLINEPNT-1, figsensor.linepnt[lineid]+2*dim);
}
}