Change mjVISSTRING of connect and weld equality constraints from "Constraint" to "Equality". This is more consistent with the 'E' shortcut key and with mjDISABLESTRING ("constraint" means all constraints, "equality" means bilateral constraints).

Also remove unused ampersands from `mjVISSTRING` names, these are a remnant from a very old version of the UI framework.

PiperOrigin-RevId: 593469811
Change-Id: I0f6f73c9f5d2c61b2280f395f76434b0710ce4f3
This commit is contained in:
Yuval Tassa
2023-12-24 12:06:05 -08:00
committed by Copybara-Service
parent 2a46ca3787
commit 4c066a26b5
3 changed files with 22 additions and 26 deletions
+1 -1
View File
@@ -822,7 +822,7 @@ Euler integrator, semi-implicit in velocity.
self.assertLen(mujoco.mjRNDSTRING, mujoco.mjtRndFlag.mjNRNDFLAG)
self.assertEqual(mujoco.mjDISABLESTRING[11], 'Refsafe')
self.assertEqual(mujoco.mjVISSTRING[mujoco.mjtVisFlag.mjVIS_INERTIA],
('&Inertia', '0', 'I'))
('Inertia', '0', 'I'))
def test_enum_values(self):
self.assertEqual(mujoco.mjtJoint.mjJNT_FREE, 0)
+4 -8
View File
@@ -837,15 +837,8 @@ void MakeRenderingSection(mj::Simulate* sim, const mjModel* m, int oldstate) {
{mjITEM_END}
};
for (int i=0; i<mjNVISFLAG; i++) {
// set name, remove "&"
// set name
mju::strcpy_arr(defFlag[0].name, mjVISSTRING[i][0]);
for (int j=0; j<strlen(mjVISSTRING[i][0]); j++) {
if (mjVISSTRING[i][0][j]=='&') {
mju_strncpy(
defFlag[0].name+j, mjVISSTRING[i][0]+j+1, mju::sizeof_arr(defFlag[0].name)-j);
break;
}
}
// set shortcut and data
if (mjVISSTRING[i][2][0]) {
@@ -868,7 +861,10 @@ void MakeRenderingSection(mj::Simulate* sim, const mjModel* m, int oldstate) {
// add rendering flags
mjui_add(&sim->ui0, defOpenGL);
for (int i=0; i<mjNRNDFLAG; i++) {
// set name
mju::strcpy_arr(defFlag[0].name, mjRNDSTRING[i][0]);
// set shortcut and data
if (mjRNDSTRING[i][2][0]) {
mju::sprintf_arr(defFlag[0].other, " %s", mjRNDSTRING[i][2]);
} else {
+17 -17
View File
@@ -68,29 +68,29 @@ const char* mjFRAMESTRING[mjNFRAME] = {
// visual options: {name, initial value, shortcut}
const char* mjVISSTRING[mjNVISFLAG][3] = {
{"Convex &Hull", "0", "H"},
{"Te&xture", "1", "X"},
{"&Joint", "0", "J"},
{"Convex Hull", "0", "H"},
{"Texture", "1", "X"},
{"Joint", "0", "J"},
{"Camera", "0", "Q"},
{"Act&uator", "0", "U"},
{"Act&ivation", "0", ","},
{"Actuator", "0", "U"},
{"Activation", "0", ","},
{"Light", "0", "Z"},
{"Tendon", "1", "V"},
{"Range Finder", "1", "Y"},
{"Co&nstraint", "0", "E"},
{"&Inertia", "0", "I"},
{"Equality", "0", "E"},
{"Inertia", "0", "I"},
{"Scale Inertia", "0", "'"},
{"Pertur&b Force", "0", "B"},
{"Perturb &Object", "1", "O"},
{"&Contact Point", "0", "C"},
{"Perturb Force", "0", "B"},
{"Perturb Object", "1", "O"},
{"Contact Point", "0", "C"},
{"Island", "1", ""}, // TODO(b/295296178): turn off after islands are on by default.
{"Contact &Force", "0", "F"},
{"Contact S&plit", "0", "P"},
{"&Transparent", "0", "T"},
{"&Auto Connect", "0", "A"},
{"Center of &Mass", "0", "M"},
{"S&elect Point", "0", ""},
{"Static Bo&dy", "1", "D"},
{"Contact Force", "0", "F"},
{"Contact Split", "0", "P"},
{"Transparent", "0", "T"},
{"Auto Connect", "0", "A"},
{"Center of Mass", "0", "M"},
{"Select Point", "0", ""},
{"Static Body", "1", "D"},
{"Skin", "1", ";"},
{"Flex Vert", "0", ""},
{"Flex Edge", "0", ""},