Skip to content

Conversation

@thowell
Copy link
Collaborator

@thowell thowell commented Feb 13, 2024

Optionally, set the simulation state (qpos, qvel, time) via the Python API. Useful for visualizing state estimate in GUI during hardware in-the-loop testing.

@oscarkfpang
Copy link

Hi, this PR will be useful for my work as described in the /issue/343. Any chance to be reviewed and passed?

Copy link
Contributor

@nimrod-gileadi nimrod-gileadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you still want to submit this...

task->Transition(model, data_);
agent_.SetState(data_);

// Set simulation state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be done in ui_agent_service too.

if (request->set_simulation()) {
Agent::StepJob job = [&agent_data = data_](
Agent* agent, const mjModel* model, mjData* data) {
mju_copy(data->qpos, agent_data->qpos, model->nq);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is missing some states. Copy the rest of them: time, act, mocap_pos, mocap_quat, userdata.

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

Successfully merging this pull request may close these issues.

3 participants