Differences
This shows you the differences between two versions of the page.
— | ref:lua_model [2023/12/14 16:03] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== LuaModel ====== | ||
+ | [[model|Model]] type for use in lua scripting. | ||
+ | |||
+ | See [[script_controller|ScriptController]] and [[script_measure|ScriptMeasure]] for details on scripting. | ||
+ | |||
+ | ==== Public Functions ==== | ||
+ | ^ Function ^ Description ^ | ||
+ | | LuaNumber **time**() | get the current simulation time [s] | | ||
+ | | LuaNumber **delta_time**() | get the previous simulation delta time [s] | | ||
+ | | LuaNumber **max_duration**() | get the max_duration of the simulation objective | | ||
+ | | LuaVec3 **com_pos**() | get the current com position [m] | | ||
+ | | LuaVec3 **com_vel**() | get the current com velocity [m/s] | | ||
+ | | LuaNumber **mass**() | get the model mass [kg] | | ||
+ | | LuaVec3 **gravity**() | get the gravitational pull [m/s^2] | | ||
+ | | [[lua_actuator|LuaActuator]] **actuator**(int index) | get the actuator at index (starting at 1) | | ||
+ | | [[lua_actuator|LuaActuator]] **find_actuator**(LuaString name) | find an actuator with a specific name | | ||
+ | | int **actuator_count**() | number of actuators | | ||
+ | | [[lua_dof|LuaDof]] **dof**(int index) | get the muscle at index (starting at 1) | | ||
+ | | [[lua_dof|LuaDof]] **find_dof**(LuaString name) | find a muscle with a specific name | | ||
+ | | int **dof_count**() | number of dofs | | ||
+ | | [[lua_muscle|LuaMuscle]] **muscle**(int index) | get the muscle at index (starting at 1) | | ||
+ | | [[lua_muscle|LuaMuscle]] **find_muscle**(LuaString name) | find a muscle with a specific name | | ||
+ | | int **muscle_count**() | number of muscles | | ||
+ | | [[lua_body|LuaBody]] **body**(int index) | get the body at index (starting at 1) | | ||
+ | | [[lua_body|LuaBody]] **find_body**(LuaString name) | find a body with a specific name | | ||
+ | | int **find_body_index**(LuaString name) | find a body index with a specific name | | ||
+ | | int **body_count**() | number of bodies | | ||
+ | | [[lua_body|LuaBody]] **ground_body**() | get the ground (static) body | | ||
+ | | [[lua_joint|LuaJoint]] **joint**(int index) | get the joint at index (starting at 1) | | ||
+ | | [[lua_joint|LuaJoint]] **find_joint**(LuaString name) | find a joint with a specific name | | ||
+ | | int **joint_count**() | number of joints | | ||
+ | |||
+ | < | ||