Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering contact force problem. #487

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mujoco_py/mjviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from multiprocessing import Process, Queue
from threading import Lock


class MjViewerBasic(cymj.MjRenderContextWindow):
"""
A simple display GUI showing the scene of an :class:`.MjSim` with a mouse-movable camera.
Expand Down Expand Up @@ -252,7 +251,7 @@ def _create_full_overlay(self):
self.add_overlay(const.GRID_TOPLEFT, "Switch camera (#cams = %d)" % (self._ncam + 1),
"[Tab] (camera ID = %d)" % self.cam.fixedcamid)
self.add_overlay(const.GRID_TOPLEFT, "[C]ontact forces", "Off" if self.vopt.flags[
10] == 1 else "On")
const.VIS_CONTACTFORCE] == 0 else "On")
self.add_overlay(
const.GRID_TOPLEFT, "Referenc[e] frames", "Off" if self.vopt.frame == 1 else "On")
self.add_overlay(const.GRID_TOPLEFT,
Expand Down Expand Up @@ -339,8 +338,7 @@ def key_callback(self, window, key, scancode, action, mods):
elif key == glfw.KEY_F: # Speeds up simulation.
self._run_speed *= 2.0
elif key == glfw.KEY_C: # Displays contact forces.
vopt = self.vopt
vopt.flags[10] = vopt.flags[11] = not vopt.flags[10]
self.vopt.flags[const.VIS_CONTACTFORCE] = not self.vopt.flags[const.VIS_CONTACTFORCE]
elif key == glfw.KEY_D: # turn off / turn on rendering every frame.
self._render_every_frame = not self._render_every_frame
elif key == glfw.KEY_E:
Expand Down