ros2_control - rolling
Loading...
Searching...
No Matches
mujoco::plugin::lidar::Lidar Class Reference

Lidar sensor implementation based on mj_multiRay. More...

#include <3dlidar.h>

Public Member Functions

 Lidar (Lidar &&)=default
void Reset (const mjModel *m, int instance)
void Compute (const mjModel *m, mjData *d, int instance)
void Visualize (const mjModel *m, mjData *d, const mjvOption *opt, mjvScene *scn, int instance)

Static Public Member Functions

static Lidar * Create (const mjModel *m, mjData *d, int instance)
static void RegisterPlugin ()

Detailed Description

Lidar sensor implementation based on mj_multiRay.

The sensor supports synchronous and asynchronous operations, as lidar computations can get quite heavy with many rays. In either mode, raycasting computations are done at the requested update_period_.

  • Synchronous: the computation blocks mj_step and updates the sensor's data immediately.
  • Asynchronous: a copy of mjData is taken and a background thread handles the expensive raycasting, then writes results to the sensor's data block on the next update. This means readings may be 1 update rate timestep behind reality, or possibly longer if the computation cannot complete in one cycle. The included timestamp contains the simulation time the data was copied from, so consumers can check how delayed sensor readings are. Note that copying mjData is expensive, so it is up to consumers of this plugin to decide if the timing tradeoff is worth it.

We recommend users try the simulate app's profiler function to weigh the benefits and time costs of both modes.


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