Skip to content

Commit b2a669f

Browse files
authored
Increase motion resolution (#88)
The motion step is too high. It is proposed to increase the motion resolution of the joints
1 parent 03e38e3 commit b2a669f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/controls.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ export class URDFControls extends GUI {
144144
'Grid'
145145
);
146146

147-
const minHeight = -2;
148-
const maxHeight = 5;
149-
const stepSize = 0.1;
147+
const minHeight = -2.0;
148+
const maxHeight = 5.0;
149+
const stepSize = 0.001;
150150
this.controls.scene.height = this._sceneFolder.add(
151151
sceneSettings,
152152
'Height',
@@ -196,11 +196,11 @@ export class URDFControls extends GUI {
196196
const limitMax = Number(joints[name].limit.upper);
197197

198198
// Skip joint if the limits are not defined
199-
if (limitMin === 0 && limitMax === 0) {
199+
if (limitMin === 0.0 && limitMax === 0.0) {
200200
return;
201201
}
202202

203-
const stepSize = (limitMax - limitMin) / 20;
203+
const stepSize = (limitMax - limitMin) / 100.0;
204204
const initValue = joints[name].jointValue[0];
205205

206206
this.controls.joints[name] = this._jointsFolder.add(
@@ -318,9 +318,9 @@ export class URDFControls extends GUI {
318318
const angleStep = 0.01;
319319

320320
// Intensity limits and steps
321-
const minIntensity = 0;
322-
const maxIntensity = 10;
323-
const intensityStep = 0.1;
321+
const minIntensity = 0.0;
322+
const maxIntensity = 10.0;
323+
const intensityStep = 0.01;
324324

325325
// Controls for directional light
326326
this.controls.lights.directional = {

src/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class URDFLayout extends PanelLayout {
209209
this._loader.robotModel.joints
210210
);
211211
Object.keys(jointControl).forEach((jointName: string) => {
212-
jointControl[jointName].onChange((newValue = 0) => {
212+
jointControl[jointName].onChange((newValue = 0.0) => {
213213
this._setJointValue(jointName, newValue);
214214
});
215215
});

0 commit comments

Comments
 (0)