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

Plugin to publish clock topic. More...

#include <ClockPublisher.h>

Public Member Functions

 ClockPublisher (ClockPublisher &&)=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...
 

Static Public Member Functions

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

Protected Member Functions

 ClockPublisher (const mjModel *m, mjData *d, const std::string &topic_name, mjtNum publish_rate, bool use_sim_time)
 Constructor. More...
 

Protected Attributes

std::shared_ptr< ros::NodeHandle > nh_
 ROS node handle. More...
 
ros::Publisher pub_
 ROS publisher for clock. More...
 
std::string topic_name_
 Topic name of clock. More...
 
int publish_skip_ = 0
 Iteration interval to skip ROS publish. More...
 
bool use_sim_time_ = false
 Value of use_sim_time rosparam. More...
 
int sim_cnt_ = 0
 Iteration count of simulation. More...
 

Detailed Description

Plugin to publish clock topic.

Definition at line 16 of file ClockPublisher.h.

Constructor & Destructor Documentation

◆ ClockPublisher() [1/2]

MujocoRosUtils::ClockPublisher::ClockPublisher ( ClockPublisher &&  )
default

Copy constructor.

◆ ClockPublisher() [2/2]

MujocoRosUtils::ClockPublisher::ClockPublisher ( const mjModel *  m,
mjData *  d,
const std::string &  topic_name,
mjtNum  publish_rate,
bool  use_sim_time 
)
protected

Constructor.

Parameters
mmodel
ddata
topic_nametopic name of clock
publish_ratepublish rate
use_sim_timevalue of use_sim_time rosparam

Definition at line 117 of file ClockPublisher.cpp.

Member Function Documentation

◆ compute()

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

Compute.

Parameters
mmodel
ddata
plugin_idplugin ID

Definition at line 148 of file ClockPublisher.cpp.

◆ Create()

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

Create an instance.

Parameters
mmodel
ddata
plugin_idplugin ID

Definition at line 70 of file ClockPublisher.cpp.

◆ RegisterPlugin()

void MujocoRosUtils::ClockPublisher::RegisterPlugin ( )
static

Register plugin.

Definition at line 12 of file ClockPublisher.cpp.

◆ reset()

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

Reset.

Parameters
mmodel
plugin_idplugin ID

Definition at line 142 of file ClockPublisher.cpp.

Member Data Documentation

◆ nh_

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

ROS node handle.

Definition at line 58 of file ClockPublisher.h.

◆ pub_

ros::Publisher MujocoRosUtils::ClockPublisher::pub_
protected

ROS publisher for clock.

Definition at line 61 of file ClockPublisher.h.

◆ publish_skip_

int MujocoRosUtils::ClockPublisher::publish_skip_ = 0
protected

Iteration interval to skip ROS publish.

Definition at line 67 of file ClockPublisher.h.

◆ sim_cnt_

int MujocoRosUtils::ClockPublisher::sim_cnt_ = 0
protected

Iteration count of simulation.

Definition at line 73 of file ClockPublisher.h.

◆ topic_name_

std::string MujocoRosUtils::ClockPublisher::topic_name_
protected

Topic name of clock.

Definition at line 64 of file ClockPublisher.h.

◆ use_sim_time_

bool MujocoRosUtils::ClockPublisher::use_sim_time_ = false
protected

Value of use_sim_time rosparam.

Definition at line 70 of file ClockPublisher.h.


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