mujoco_ros_utils
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MujocoRosUtils::ExternalForce Class Reference

Plugin to apply external force. More...

#include <ExternalForce.h>

Public Member Functions

 ExternalForce (ExternalForce &&)=default
 Copy constructor. More...
 
void reset (const mjModel *m, int plugin_id)
 Reset. More...
 
void compute (const mjModel *m, mjData *d, int plugin_id)
 Compute. More...
 
void visualize (const mjModel *m, mjData *d, const mjvOption *opt, mjvScene *scn, int plugin_id)
 Visualize. More...
 

Static Public Member Functions

static void RegisterPlugin ()
 Register plugin. More...
 
static ExternalForceCreate (const mjModel *m, mjData *d, int plugin_id)
 Create an instance. More...
 

Protected Member Functions

 ExternalForce (const mjModel *m, mjData *d, int body_id, const std::string &topic_name, mjtNum vis_scale)
 Constructor. More...
 
void callback (const mujoco_ros_utils::ExternalForce::ConstPtr &msg)
 Constructor. More...
 

Protected Attributes

std::shared_ptr< ros::NodeHandle > nh_
 ROS node handle. More...
 
ros::CallbackQueue callbackQueue_
 ROS callback queue. More...
 
ros::Subscriber sub_
 ROS publisher for external force. More...
 
int body_id_ = -1
 Body ID. More...
 
std::string topic_name_
 Topic name of external force. More...
 
std::shared_ptr< mujoco_ros_utils::ExternalForce > msg_
 External force message. More...
 
mjtNum end_time_ = -1
 End time to apply external force (-1 if no external force is applied) More...
 
mjtNum vis_scale_
 Arrow length scale (negative value for no visualization) More...
 

Detailed Description

Plugin to apply external force.

Definition at line 18 of file ExternalForce.h.

Constructor & Destructor Documentation

◆ ExternalForce() [1/2]

MujocoRosUtils::ExternalForce::ExternalForce ( ExternalForce &&  )
default

Copy constructor.

◆ ExternalForce() [2/2]

MujocoRosUtils::ExternalForce::ExternalForce ( const mjModel *  m,
mjData *  d,
int  body_id,
const std::string &  topic_name,
mjtNum  vis_scale 
)
protected

Constructor.

Parameters
mmodel
ddata
body_idbody ID
topic_nametopic name of external force
vis_scalearrow length scale

Definition at line 112 of file ExternalForce.cpp.

Member Function Documentation

◆ callback()

void MujocoRosUtils::ExternalForce::callback ( const mujoco_ros_utils::ExternalForce::ConstPtr &  msg)
protected

Constructor.

Parameters
msgexternal force message

Definition at line 237 of file ExternalForce.cpp.

◆ compute()

void MujocoRosUtils::ExternalForce::compute ( const mjModel *  m,
mjData *  d,
int  plugin_id 
)

Compute.

Parameters
mmodel
ddata
plugin_idplugin ID

Definition at line 144 of file ExternalForce.cpp.

◆ Create()

ExternalForce * MujocoRosUtils::ExternalForce::Create ( const mjModel *  m,
mjData *  d,
int  plugin_id 
)
static

Create an instance.

Parameters
mmodel
ddata
plugin_idplugin ID

Definition at line 74 of file ExternalForce.cpp.

◆ RegisterPlugin()

MujocoRosUtils::ExternalForce::RegisterPlugin ( )
static

Register plugin.

Definition at line 10 of file ExternalForce.cpp.

◆ reset()

void MujocoRosUtils::ExternalForce::reset ( const mjModel *  m,
int  plugin_id 
)

Reset.

Parameters
mmodel
plugin_idplugin ID

Definition at line 137 of file ExternalForce.cpp.

◆ visualize()

void MujocoRosUtils::ExternalForce::visualize ( const mjModel *  m,
mjData *  d,
const mjvOption *  opt,
mjvScene *  scn,
int  plugin_id 
)

Visualize.

Parameters
mmodel
ddata
optvisualization option
scnrendering scene
plugin_idplugin ID

Definition at line 190 of file ExternalForce.cpp.

Member Data Documentation

◆ body_id_

int MujocoRosUtils::ExternalForce::body_id_ = -1
protected

Body ID.

Definition at line 83 of file ExternalForce.h.

◆ callbackQueue_

ros::CallbackQueue MujocoRosUtils::ExternalForce::callbackQueue_
protected

ROS callback queue.

Definition at line 77 of file ExternalForce.h.

◆ end_time_

mjtNum MujocoRosUtils::ExternalForce::end_time_ = -1
protected

End time to apply external force (-1 if no external force is applied)

Definition at line 92 of file ExternalForce.h.

◆ msg_

std::shared_ptr<mujoco_ros_utils::ExternalForce> MujocoRosUtils::ExternalForce::msg_
protected

External force message.

Definition at line 89 of file ExternalForce.h.

◆ nh_

std::shared_ptr<ros::NodeHandle> MujocoRosUtils::ExternalForce::nh_
protected

ROS node handle.

Definition at line 74 of file ExternalForce.h.

◆ sub_

ros::Subscriber MujocoRosUtils::ExternalForce::sub_
protected

ROS publisher for external force.

Definition at line 80 of file ExternalForce.h.

◆ topic_name_

std::string MujocoRosUtils::ExternalForce::topic_name_
protected

Topic name of external force.

Definition at line 86 of file ExternalForce.h.

◆ vis_scale_

mjtNum MujocoRosUtils::ExternalForce::vis_scale_
protected

Arrow length scale (negative value for no visualization)

Definition at line 95 of file ExternalForce.h.


The documentation for this class was generated from the following files: