Skip to content

Double idLocal for debug drawings #5

@vincenzosu

Description

@vincenzosu

In #45 each figure have been provided by a idLocal in a way to access the right figure on the structure ptrDebugDrawingsScene->geom. When a geom object mjvGeom is added there, it will be displayed in the simulator. The idLocal have been added because I could not figure out how to retreive the right mjvGeom when two object with the same type mjvGeom.type have been instantiated (i.e. initializated and put into the structure ptrDebugDrawingsScene->geom ): in any case the variable idLocal provide a secure acces the right mjvGeom into ptrDebugDrawingsScene->geom.

DebugDrawings::drawSphere(0, P1, 0.3, color);
DebugDrawings::drawCylinder(0, P2,  0.3, 0.4, color);

Actually if two different call of drawing have the same idLocal, they mix up and the first one is 'cancelled' by the second call of the drawing the the same idLocal ( so we will see a cylynder spawning and not the sphere ). We need to find a robust way to ensure uniqueness of idLocal so that in the above code only the sphere will be spawned and not the cylinder.

EDIT ( suggestion ): this check may be done into the init function checking if the ID already exist before initialize it

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions