mj-kdl-wrapper  0.1.0
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
mj_kdl Namespace Reference

Classes

struct  AttachmentSpec
 
struct  Robot
 
struct  RobotSpec
 
struct  SceneObject
 
struct  SceneSpec
 
struct  TableSpec
 
struct  VideoRecorder
 
struct  Viewer
 

Typedefs

using ControlCb = std::function< void(mjModel *m, mjData *d)>
 

Enumerations

enum class  LogLevel { LogLevel::NONE = 0 , LogLevel::INFO = 1 , LogLevel::WARN = 2 , LogLevel::ERROR = 3 }
 
enum class  Shape { Shape::BOX , Shape::SPHERE , Shape::CYLINDER }
 
enum class  CtrlMode { CtrlMode::POSITION , CtrlMode::TORQUE }
 
enum class  VideoResolution {
  VideoResolution::R360p = 360 , VideoResolution::R480p = 480 , VideoResolution::R720p = 720 , VideoResolution::R1080p = 1080 ,
  VideoResolution::R2K = 1440 , VideoResolution::R4K = 2160
}
 

Functions

void set_log_level (LogLevel level)
 
LogLevel get_log_level ()
 
bool save_model_xml (const mjModel *model, const char *path)
 
bool init_robot_from_mjcf (Robot *r, mjModel *model, mjData *data, const char *base_body, const char *tip_body, const char *prefix="", const char *tool_body=nullptr)
 
bool attach_to_spec (mjSpec *robot_spec, const AttachmentSpec *a)
 
bool build_scene (mjModel **out_model, mjData **out_data, const SceneSpec *spec)
 
void destroy_scene (mjModel *model, mjData *data)
 
bool init_window (Viewer *v, Robot *r, const char *title="MuJoCo", int width=1280, int height=720)
 
bool init_window_sim (Viewer *v, Robot *r, const char *title="MuJoCo")
 
void cleanup (Robot *r)
 
void cleanup (Viewer *v)
 
bool init_video_recorder (VideoRecorder *vr, mjModel *model, const char *out_path, int width=1280, int height=720, int fps=60)
 
bool init_video_recorder (VideoRecorder *vr, mjModel *model, const char *out_path, VideoResolution resolution, int fps=60)
 
bool record_frame (VideoRecorder *vr, mjModel *model, mjData *data)
 
void cleanup (VideoRecorder *vr)
 
void step (Robot *s)
 
void step_n (Robot *s, int n)
 
void reset (Robot *s)
 
bool is_running (const Viewer *v)
 
bool render (Viewer *v, const Robot *r)
 
bool render (Viewer *v, mjModel *m, mjData *d)
 
bool tick (Viewer *v, Robot *r)
 
bool tick (Viewer *v, mjModel *m, mjData *d)
 
void update (Robot *r)
 
void set_joint_pos (Robot *r, const KDL::JntArray &q, bool call_forward=true)
 
bool scene_add_object (mjModel **model, mjData **data, SceneSpec *spec, const SceneObject &obj)
 
bool scene_remove_object (mjModel **model, mjData **data, SceneSpec *spec, const std::string &name)
 
void run_simulate_ui (mjModel *m, mjData *d, const char *path, ControlCb physics_cb=nullptr)
 
void add_skybox_to_spec (mjSpec *spec)
 
void add_floor_to_spec (mjSpec *spec)
 
void add_table_to_spec (mjSpec *spec, const TableSpec &t)
 
void add_objects_to_spec (mjSpec *spec, const std::vector< SceneObject > &objects)
 
void configure_spec (mjSpec *spec, const SceneSpec *sc)
 
bool compile_and_make_data (mjSpec *spec, mjModel **out_model, mjData **out_data)
 
void ensure_plugins_loaded ()
 

Variables

LogLevel g_log_level = LogLevel::ERROR
 

Typedef Documentation

◆ ControlCb

using mj_kdl::ControlCb = typedef std::function<void(mjModel *m, mjData *d)>

Definition at line 621 of file mj_kdl_wrapper.hpp.

Function Documentation

◆ run_simulate_ui()

void mj_kdl::run_simulate_ui ( mjModel *  m,
mjData *  d,
const char *  path,
ControlCb  physics_cb = nullptr 
)