Skip to content

Commit

Permalink
build: prevents unreachable code on NO_BACKENerror
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidPL1 committed Dec 6, 2024
1 parent 7e28e2e commit e0a90e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mujoco_ros/src/offscreen_rendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,17 @@ void MujocoEnv::offscreenRenderLoop()
offscreen_.request_pending.store(false);
return;
}
#else
#endif

#if RENDER_BACKEND == NO_BACKEND
ROS_ERROR("No offscreen rendering backend available. Cannot run offscreen rendering");
settings_.render_offscreen = false;
settings_.visual_init_request = false;
offscreen_.request_pending.store(false);
is_rendering_running_ = 0;
ROS_DEBUG("Exiting offscreen render loop");
return;
#endif

#else
is_rendering_running_ = 1;
ROS_DEBUG_NAMED("offscreen_rendering", "Creating offscreen rendering resources ...");
mjv_defaultCamera(&offscreen_.cam);
Expand Down Expand Up @@ -414,6 +417,7 @@ void MujocoEnv::offscreenRenderLoop()
}
is_rendering_running_ = 0;
ROS_DEBUG("Exiting offscreen render loop");
#endif
}

} // namespace mujoco_ros

0 comments on commit e0a90e1

Please sign in to comment.