Mujoco KDL Wrapper  0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
mj_kdl Namespace Reference

Classes

struct  CameraConf
class  CameraRosPublisher
struct  Status
struct  AttachTarget
struct  CtrlModeSpec
struct  AttachmentSpec
struct  RobotSpec
struct  SceneObject
struct  SiteSpec
struct  CameraSpec
struct  SceneSpec
struct  ForceTorqueSensorSpec
struct  ForceTorqueReading
struct  ForceTorqueSensor
struct  ToolFrameSpec
struct  RobotPorts
struct  Robot
struct  Viewer
struct  VideoRecorder
struct  ResetOptions
struct  ResetInfo
struct  ResetContext
struct  SceneJointReading
struct  SceneJointSlot
struct  SceneFreeBodyReading
struct  SceneFreeBodySlot
struct  SceneWrenchCommand
struct  SceneWrenchSlot
struct  SceneActuatorCommand
struct  SceneActuatorSlot
struct  SceneState
struct  Env

Typedefs

using ResetHook = std::function<void(ResetContext *)>

Enumerations

enum class  LogLevel { LogLevel::INFO = 0 , LogLevel::WARN = 1 , LogLevel::ERROR = 2 , LogLevel::NONE = 3 }
enum class  AttachKind { AttachKind::World , AttachKind::Body , AttachKind::Site , AttachKind::Frame }
enum class  CtrlMode { CtrlMode::POSITION , CtrlMode::TORQUE , CtrlMode::VELOCITY }
enum class  Shape { Shape::Unspecified , Shape::BOX , Shape::SPHERE , Shape::CYLINDER }
enum class  Condim : int { Condim::Tangential = 3 , Condim::Torsional = 4 , Condim::Rolling = 6 }
enum class  VideoResolution {
  VideoResolution::R360p = 360 , VideoResolution::R480p = 480 , VideoResolution::R720p = 720 , VideoResolution::R1080p = 1080 ,
  VideoResolution::R2K = 1440 , VideoResolution::R4K = 2160
}

Functions

bool write_png_rgb (const std::string &path, const std::uint8_t *rgb, int width, int height)
void set_log_level (LogLevel level)
LogLevel get_log_level ()
Status save_model_xml (const mjModel *model, const char *path)
Status init_robot_from_mjcf (Robot *r, Env *env, const char *base_body, const char *tip_body, const char *prefix="", const ToolFrameSpec *tool=nullptr)
Status init_robot_from_chain (Robot *r, Env *env, const KDL::Chain &chain, const std::vector< std::string > &joint_names, const char *prefix="", const ToolFrameSpec *tool=nullptr)
std::vector< double > joint_force_limits (const Robot *r, double fallback=1e6)
Status build_scene (mjModel **out_model, mjData **out_data, const SceneSpec *spec)
void destroy_scene (mjModel *model, mjData *data)
Status init_env (Env *env, const SceneSpec *spec)
ResetInfo reset (Env *env, const ResetOptions *options=nullptr)
Status open_viewer (Env *env, const char *title="MuJoCo")
void clear_trace (Viewer *v)
void add_trace_segment (Viewer *v, const KDL::Vector &a, const KDL::Vector &b, const float rgba[4]=nullptr)
void add_overlay_arrow (Viewer *v, const KDL::Vector &from, const KDL::Vector &dir, double length, const float rgba[4]=nullptr)
void cleanup (Robot *r)
void cleanup (Env *env)
Status init_video_recorder (VideoRecorder *vr, mjModel *model, const char *out_path, int width=1280, int height=720, int fps=60)
Status init_video_recorder (VideoRecorder *vr, mjModel *model, const char *out_path, VideoResolution resolution, int fps=60)
bool record_frame (VideoRecorder *vr, Env *env)
Status init_offscreen (VideoRecorder *vr, mjModel *model, int width, int height)
bool render_rgb (VideoRecorder *vr, Env *env, std::uint8_t *out)
bool render_rgb (VideoRecorder *vr, Env *env, std::function< void(const std::uint8_t *rgb)> done)
void cleanup (VideoRecorder *vr)
bool step (Env *env)
void pace_realtime (Env *env)
bool is_running (const Viewer *v)
bool key_pressed (const Viewer *v, int glfw_key)
void capture_key (Viewer *v, int glfw_key, bool capture=true)
void update (Env *env)
Status set_control_mode (Robot *r, CtrlMode mode)
Status set_control_mode (Env *env, int robot, CtrlMode mode)
SceneJointSlot * bind_scene_joint (SceneState *s, const char *joint_name)
SceneFreeBodySlot * bind_scene_free_body (SceneState *s, const char *body_name)
SceneWrenchSlot * bind_scene_wrench (SceneState *s, const char *body_name)
SceneActuatorSlot * bind_scene_actuator (SceneState *s, const char *name)
void set_joint_pos (Robot *r, const KDL::JntArray &q)
void set_body_pose (Env *env, const char *body_name, const double pos[3], const double *quat=nullptr)
Status scene_add_object (Env *env, const SceneObject &obj)
Status scene_remove_object (Env *env, const std::string &name)
bool get_site_frame (Env *env, const char *site_name, KDL::Frame *out)
bool get_body_frame (Env *env, const char *body_name, KDL::Frame *out)
bool use_camera (Viewer *v, const mjModel *model, const char *name)
void set_free_camera (Viewer *v, double distance, double azimuth, double elevation, const std::array< double, 3 > &lookat)

Variables

LogLevel g_log_level = LogLevel::INFO

Typedef Documentation

◆ ResetHook

using mj_kdl::ResetHook = std::function<void(ResetContext *)>

Definition at line 521 of file mj_kdl_wrapper.hpp.

Function Documentation

◆ write_png_rgb()

bool mj_kdl::write_png_rgb ( const std::string & path,
const std::uint8_t * rgb,
int width,
int height )