Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving non-kinematic scene objects & #62

Open
Sebastian-Schroder opened this issue Dec 1, 2022 · 1 comment
Open

Moving non-kinematic scene objects & #62

Sebastian-Schroder opened this issue Dec 1, 2022 · 1 comment

Comments

@Sebastian-Schroder
Copy link

Hey I was just wondering if there is an easy way to move scene models in 0.7.0. This is my attempt where we set the frame of each body and then step the rl::hal::Coach ptr, however this doesn't seem to update the

for (::std::size_t i = 0; i < model->getBodies(); ++i) // This sets all the axis models to the position of the arm transforms
        {
            auto t = model->getFrame(i);
            scene.getModel(2)->getBody(i)->setFrame(t); //! This should happen wheneve the model moves instead
        }
        sim_Controller->step();

is there any way to do this?
also is it possible to have scene models that don't have collision or remove scene models from the arm's collision using idref. these would be just used for visualising. for example adding axes onto each joint to demonstrate rotation etc etc.
Thank you

@rickertm
Copy link
Member

rickertm commented Dec 3, 2022

The rl::hal::Coach class only acts as an axis controller, with interfaces for joint positions, velocities, and torques. The step() function therefore only exchanges these messages. The socket interface in the rlCoachKin and rlCoachMdl demo applications however have additional message types for receiving updates to body frames and shape transforms.

Update frame of body j in model i (angles are EulerZYX in radians):

0 i j x y z a b c\n

Update transform of shape k in body j in model i (angles are EulerZYX in radians):

1 i j k x y z a b c\n

Update joint positions of model i (angles in radians), provided via rl::hal::Coach::setJointPosition():

2 i q0 q1 q2 ... qn\n

Request joint positions of model i (angles in radians), provided via rl::hal::Coach::getJointPosition():

6 i\n

For visualising axes, you can for instance use IndexedLineSet shapes, as these are ignored by the collision engines (see rl-examples/rlsg/frame.wrl). You can also use completely different geometry models for visualization and collision detection (see the optimized convex hull folders in rl-examples/rlsg/*.convex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants