Skip to content

How to copy value to mjcore.model.body_pos? #19

Open
@mjm522

Description

@mjm522

When I try to copy a value to this variable like this,
model.data_pos = newValue
it says,
ValueError: assignment destination is read-only.
So I tried to using the inbuilt function mjlib.mju_copy(data_d.ctypes.data_as(POINTER(c_double)), data_s.ctypes.data_as(POINTER(c_double)), c_int(length)) in the following way.
mjlib.mju_copy(model.data_pos.ctypes.data_as(POINTER(c_double)), newValue.ctypes.data_as(POINTER(c_double)), c_int(3))
This statement does not produce any error, nevertheless the value remain unchanged.
Could anyone please tell me how to copy a new value to it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions