Mujoco KDL Wrapper  0.2.2
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
mj_kdl::Robot Struct Reference

#include <mj_kdl_wrapper.hpp>

Public Attributes

mjModel * model = nullptr
mjData * data = nullptr
KDL::Chain chain
KDL::Frame tip_T_tcp = KDL::Frame::Identity()
bool has_tcp_frame = false
std::string tcp_site
int n_joints = 0
std::vector< std::string > joint_names
std::vector< std::pair< double, double > > joint_limits
std::vector< ForceTorqueSensorft_sensors
CtrlMode ctrl_mode = CtrlMode::POSITION
bool paused = false
std::vector< double > jnt_pos_msr
std::vector< double > jnt_vel_msr
std::vector< double > jnt_trq_msr
std::vector< double > jnt_pos_cmd
std::vector< double > jnt_trq_cmd
std::vector< int > kdl_to_mj_qpos
std::vector< int > kdl_to_mj_dof
std::vector< int > kdl_to_mj_ctrl

Detailed Description

Runtime handle for one KDL-tracked articulation inside a MuJoCo scene. model/data are borrowed (never freed by cleanup()); call destroy_scene() separately.

Workflow:

  1. Call init_robot_from_mjcf() - populates configuration and sizes port vectors to n_joints.
  2. Each control step: read *_msr ports (updated by update()), fill *_cmd ports, call update() to apply commands to MuJoCo and read back sensor state.

Definition at line 314 of file mj_kdl_wrapper.hpp.

Member Data Documentation

◆ chain

◆ ctrl_mode

CtrlMode mj_kdl::Robot::ctrl_mode = CtrlMode::POSITION

Definition at line 329 of file mj_kdl_wrapper.hpp.

Referenced by main(), main(), and admittance_ft::run().

◆ data

mjData* mj_kdl::Robot::data = nullptr

Definition at line 318 of file mj_kdl_wrapper.hpp.

Referenced by admittance_ft::measured_force(), and admittance_ft::tare_force().

◆ ft_sensors

std::vector<ForceTorqueSensor> mj_kdl::Robot::ft_sensors

Definition at line 326 of file mj_kdl_wrapper.hpp.

Referenced by TEST_F().

◆ has_tcp_frame

bool mj_kdl::Robot::has_tcp_frame = false

Definition at line 321 of file mj_kdl_wrapper.hpp.

◆ jnt_pos_cmd

std::vector<double> mj_kdl::Robot::jnt_pos_cmd

Definition at line 334 of file mj_kdl_wrapper.hpp.

Referenced by main().

◆ jnt_pos_msr

std::vector<double> mj_kdl::Robot::jnt_pos_msr

Definition at line 331 of file mj_kdl_wrapper.hpp.

Referenced by admittance_ft::current_tcp(), and main().

◆ jnt_trq_cmd

std::vector<double> mj_kdl::Robot::jnt_trq_cmd

Definition at line 335 of file mj_kdl_wrapper.hpp.

Referenced by main().

◆ jnt_trq_msr

std::vector<double> mj_kdl::Robot::jnt_trq_msr

Definition at line 333 of file mj_kdl_wrapper.hpp.

◆ jnt_vel_msr

std::vector<double> mj_kdl::Robot::jnt_vel_msr

Definition at line 332 of file mj_kdl_wrapper.hpp.

Referenced by main().

◆ joint_limits

std::vector<std::pair<double, double> > mj_kdl::Robot::joint_limits

Definition at line 325 of file mj_kdl_wrapper.hpp.

◆ joint_names

std::vector<std::string> mj_kdl::Robot::joint_names

Definition at line 324 of file mj_kdl_wrapper.hpp.

◆ kdl_to_mj_ctrl

std::vector<int> mj_kdl::Robot::kdl_to_mj_ctrl

Definition at line 340 of file mj_kdl_wrapper.hpp.

◆ kdl_to_mj_dof

std::vector<int> mj_kdl::Robot::kdl_to_mj_dof

Definition at line 339 of file mj_kdl_wrapper.hpp.

Referenced by main().

◆ kdl_to_mj_qpos

std::vector<int> mj_kdl::Robot::kdl_to_mj_qpos

Definition at line 338 of file mj_kdl_wrapper.hpp.

◆ model

mjModel* mj_kdl::Robot::model = nullptr

◆ n_joints

int mj_kdl::Robot::n_joints = 0

Definition at line 323 of file mj_kdl_wrapper.hpp.

Referenced by admittance_ft::current_tcp(), main(), and admittance_ft::run().

◆ paused

bool mj_kdl::Robot::paused = false

Definition at line 330 of file mj_kdl_wrapper.hpp.

◆ tcp_site

std::string mj_kdl::Robot::tcp_site

Definition at line 322 of file mj_kdl_wrapper.hpp.

◆ tip_T_tcp

KDL::Frame mj_kdl::Robot::tip_T_tcp = KDL::Frame::Identity()

Definition at line 320 of file mj_kdl_wrapper.hpp.

Referenced by main().


The documentation for this struct was generated from the following file: