Skip to content

Commit

Permalink
fix: skip user sensors in sensor plugin initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
fpatzelt authored and DavidPL1 committed Aug 5, 2024
1 parent 16b9f54 commit 6529e8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Loading and reset times are reported in the server debug log. All plugin stats c
### Fixed
* Added missing call to render callbacks in viewer. While the callbacks were still being run for offscreen rendering, the viewer did not render additional geoms added by plugins.
* *mujoco_ros_control*: fixed sometimes using wrong joint id in default hardware interface (would only be correct, if the joints appear first and in the same order in the compiled MuJoCo model).
* *mujoco_ros_sensors*: now skipping user sensors, as they should be handled in separate, dedicated plugins.

### Changed
* Moved `mujoco_ros::Viewer::Clock` definition to `mujoco_ros::Clock` (into common_types.h).
Expand Down
6 changes: 6 additions & 0 deletions mujoco_ros_sensors/src/mujoco_sensor_handler_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ void MujocoRosSensorsPlugin::initSensors(const mjModel *model, mjData *data)
int parent_id = model->site_bodyid[site_id];
int type = model->sensor_type[n];

// Skip user sensors because handling is unknown and should be done in extra plugin
if (type == mjSENS_USER) {
ROS_INFO_STREAM_NAMED("sensors", "Skipping USER sensor");
continue;
}

site = mj_id2name(const_cast<mjModel *>(model), model->sensor_objtype[n], site_id);

if (model->names[model->name_sensoradr[n]]) {
Expand Down

0 comments on commit 6529e8c

Please sign in to comment.