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

Separate collision_color in MeshcatVisualizer.loadViewerModel #2350

Merged

Conversation

stephane-caron
Copy link
Collaborator

The proposal of this PR is to add a separate collision_color argument to MeshcatVisualizer.loadViewerModel.

  • Before: color applies to both visual and collision model
  • After: color applies to visual, collision_color to collision model

This can be convenient to debug collision meshes alongside the visual model (with only color, meshes overlapped):

robot.setVisualizer(MeshcatVisualizer())
robot.initViewer(open=True)
robot.loadViewerModel(collision_color=(1.0, 0.0, 0.0, 0.3))
robot.viz.displayCollisions(True)

image

@stephane-caron stephane-caron changed the title python: Separate collision_color in MeshcatVisualizer.loadViewerModel Separate collision_color in MeshcatVisualizer.loadViewerModel Jul 25, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Hi,
This is a reminder message to please assign a proper label to this Pull Request.
The possible labels are:

  • build_collision (build pinocchio with coal support)
  • build_casadi (build pinoochio with casadi support)
  • build_autodiff (build pinocchio with cppad support)
  • build_codegen (build pinocchio with cppadcg support)
  • build_extra (build pinocchio with extra algorithms)
  • build_mpfr (build pinocchio with Boost.Multiprecision support)
  • build_sdf (build pinocchio with sdf parser)
  • build_accelerate
  • build_all (build pinocchio with all the options stated above)

Thanks.

@jcarpent
Copy link
Contributor

@stephane-caron could you rebase instead of merging ?

@stephane-caron
Copy link
Collaborator Author

@stephane-caron could you rebase instead of merging ?

Sure. GitHub gave me a button to resolve the conflict and I naively clicked on it 😊

@stephane-caron stephane-caron force-pushed the feature/meshcat_colmodcol branch from 4bcacda to d227290 Compare July 25, 2024 14:55
stephane-caron added a commit to upkie/upkie_description that referenced this pull request Jul 25, 2024
stephane-caron added a commit to upkie/upkie_description that referenced this pull request Jul 25, 2024
stephane-caron added a commit to upkie/upkie_description that referenced this pull request Jul 25, 2024
Copy link
Contributor

@jcarpent jcarpent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for visual_color too. And when color is there, it should be used for both, or mark it as deprecated option.

@jcarpent jcarpent force-pushed the feature/meshcat_colmodcol branch from a685e42 to ca87cfe Compare July 25, 2024 21:27
@jcarpent jcarpent force-pushed the feature/meshcat_colmodcol branch from 4d18ba7 to d5966e2 Compare July 27, 2024 07:06
@jcarpent jcarpent merged commit 43d9144 into stack-of-tasks:devel Jul 27, 2024
20 of 21 checks passed
nim65s added a commit to nim65s/robotpkg that referenced this pull request Oct 8, 2024
    ## [3.2.0] - 2024-08-27

    ### Fixed
    - Append pinocchio optional libraries into pkg-config file (stack-of-tasks/pinocchio#2322)
    - Fixed support of DAE meshes with MeshCat (stack-of-tasks/pinocchio#2331)
    - Fixed pointer casts in urdf parser (stack-of-tasks/pinocchio#2339)
    - Remove CMake CMP0167 warnings (stack-of-tasks/pinocchio#2347)
    - Fixed urdfdom in ROS packaging (stack-of-tasks/pinocchio#2341)
    - Fixed overview-urdf cpp example (stack-of-tasks/pinocchio#2384)
    - Fixed mjcf model without a base link parsing (stack-of-tasks/pinocchio#2386)
    - Fixed talos-simulation.py, simulation-contact-dynamics.py and simulation-closed-kinematic-chains.py examples (stack-of-tasks/pinocchio#2392)

    ### Added
    - Add getMotionAxis method to helical, prismatic, revolute and ubounded revolute joint (stack-of-tasks/pinocchio#2315)
    - Add initial compatiblity with coal (coal needs `-DCOAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON`) (stack-of-tasks/pinocchio#2323)
    - Add compatibility with jrl-cmakemodules workspace (stack-of-tasks/pinocchio#2333)
    - Add ``collision_color`` parameter to `MeshcatVisualizer.loadViewerModel` (stack-of-tasks/pinocchio#2350)
    - Add ``BuildFromMJCF`` function to RobotWrapper (stack-of-tasks/pinocchio#2363)
    - Add more CasADi examples (stack-of-tasks/pinocchio#2388)

    ### Removed
    - Remove deprecated headers related to joint constraints (stack-of-tasks/pinocchio#2382)

    ### Changed
    - Use eigenpy to expose `GeometryObject::meshMaterial` variant (stack-of-tasks/pinocchio#2315)
    - GepettoViewer is no more the default viewer for RobotWrapper (stack-of-tasks/pinocchio#2331)
    - Modernize python code base with ruff (stack-of-tasks/pinocchio#2367)
    - Restructure CppAD and CasADi examples (stack-of-tasks/pinocchio#2388)
    - Enhance and fix CppAD benchmarks outputs (stack-of-tasks/pinocchio#2393)

Packaging Changes:
- Removed patches af, an, ap: fixed upstream
- Updated patches ag, ak
nim65s added a commit to nim65s/robotpkg that referenced this pull request Oct 9, 2024
    ## [3.2.0] - 2024-08-27

    ### Fixed
    - Append pinocchio optional libraries into pkg-config file (stack-of-tasks/pinocchio#2322)
    - Fixed support of DAE meshes with MeshCat (stack-of-tasks/pinocchio#2331)
    - Fixed pointer casts in urdf parser (stack-of-tasks/pinocchio#2339)
    - Remove CMake CMP0167 warnings (stack-of-tasks/pinocchio#2347)
    - Fixed urdfdom in ROS packaging (stack-of-tasks/pinocchio#2341)
    - Fixed overview-urdf cpp example (stack-of-tasks/pinocchio#2384)
    - Fixed mjcf model without a base link parsing (stack-of-tasks/pinocchio#2386)
    - Fixed talos-simulation.py, simulation-contact-dynamics.py and simulation-closed-kinematic-chains.py examples (stack-of-tasks/pinocchio#2392)

    ### Added
    - Add getMotionAxis method to helical, prismatic, revolute and ubounded revolute joint (stack-of-tasks/pinocchio#2315)
    - Add initial compatiblity with coal (coal needs `-DCOAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON`) (stack-of-tasks/pinocchio#2323)
    - Add compatibility with jrl-cmakemodules workspace (stack-of-tasks/pinocchio#2333)
    - Add ``collision_color`` parameter to `MeshcatVisualizer.loadViewerModel` (stack-of-tasks/pinocchio#2350)
    - Add ``BuildFromMJCF`` function to RobotWrapper (stack-of-tasks/pinocchio#2363)
    - Add more CasADi examples (stack-of-tasks/pinocchio#2388)

    ### Removed
    - Remove deprecated headers related to joint constraints (stack-of-tasks/pinocchio#2382)

    ### Changed
    - Use eigenpy to expose `GeometryObject::meshMaterial` variant (stack-of-tasks/pinocchio#2315)
    - GepettoViewer is no more the default viewer for RobotWrapper (stack-of-tasks/pinocchio#2331)
    - Modernize python code base with ruff (stack-of-tasks/pinocchio#2367)
    - Restructure CppAD and CasADi examples (stack-of-tasks/pinocchio#2388)
    - Enhance and fix CppAD benchmarks outputs (stack-of-tasks/pinocchio#2393)

    ## [3.1.0] - 2024-07-04

    ### Fixed

    - Fix `appendModel` when joints after the base are in parallel (stack-of-tasks/pinocchio#2295)
    - Fix `appendModel` build when called with template arguments different than the ones from `context` (stack-of-tasks/pinocchio#2284)
    - Fix `TransformRevoleTpl::rotation` and `TransformHelicalTpl::rotation` build (stack-of-tasks/pinocchio#2284)
    - Fix compilation issue for Boost 1.85 (stack-of-tasks/pinocchio#2255)
    - Fix python bindings of `contactInverseDynamics` (stack-of-tasks/pinocchio#2263)
    - Deactivate `BUILD_WITH_LIBPYTHON` when building with PyPy (stack-of-tasks/pinocchio#2274)
    - Fix Python bindings cross building with `hpp-fcl` (stack-of-tasks/pinocchio#2288)
    - Fix build issue on Windows when a deprecated header is included (stack-of-tasks/pinocchio#2292)
    - Fix build issue on Windows when building in Debug mode (stack-of-tasks/pinocchio#2292)
    - Fix visualization of meshes in meshcat (stack-of-tasks/pinocchio#2294)
    - Fix Anymal simulation test (stack-of-tasks/pinocchio#2299)
    - Fix contact derivatives and impulse dynamics tests (stack-of-tasks/pinocchio#2300)
    - Fix CMake compatibility with old console_bridge version (stack-of-tasks/pinocchio#2312)

    ### Added

    - Python unittest for `contactInverseDynamics` function (stack-of-tasks/pinocchio#2263)
    - Added helper functions to return operation count of CasADi functions. (stack-of-tasks/pinocchio#2275)
    - C++ and Python unittest for `dIntegrateTransport` to check vector transport and its inverse (stack-of-tasks/pinocchio#2273)
    - Add kinetic and potential energy regressors (stack-of-tasks/pinocchio#2282)

    ### Removed

    - Remove header `list.hpp` include for bindings of model and rnea (stack-of-tasks/pinocchio#2263)

Packaging Changes:
- Removed patches af, an, ap: fixed upstream
- Updated patches ag, ak
nim65s added a commit to nim65s/robotpkg that referenced this pull request Oct 11, 2024
    ## [3.2.0] - 2024-08-27

    ### Fixed
    - Append pinocchio optional libraries into pkg-config file (stack-of-tasks/pinocchio#2322)
    - Fixed support of DAE meshes with MeshCat (stack-of-tasks/pinocchio#2331)
    - Fixed pointer casts in urdf parser (stack-of-tasks/pinocchio#2339)
    - Remove CMake CMP0167 warnings (stack-of-tasks/pinocchio#2347)
    - Fixed urdfdom in ROS packaging (stack-of-tasks/pinocchio#2341)
    - Fixed overview-urdf cpp example (stack-of-tasks/pinocchio#2384)
    - Fixed mjcf model without a base link parsing (stack-of-tasks/pinocchio#2386)
    - Fixed talos-simulation.py, simulation-contact-dynamics.py and simulation-closed-kinematic-chains.py examples (stack-of-tasks/pinocchio#2392)

    ### Added
    - Add getMotionAxis method to helical, prismatic, revolute and ubounded revolute joint (stack-of-tasks/pinocchio#2315)
    - Add initial compatiblity with coal (coal needs `-DCOAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL=ON`) (stack-of-tasks/pinocchio#2323)
    - Add compatibility with jrl-cmakemodules workspace (stack-of-tasks/pinocchio#2333)
    - Add ``collision_color`` parameter to `MeshcatVisualizer.loadViewerModel` (stack-of-tasks/pinocchio#2350)
    - Add ``BuildFromMJCF`` function to RobotWrapper (stack-of-tasks/pinocchio#2363)
    - Add more CasADi examples (stack-of-tasks/pinocchio#2388)

    ### Removed
    - Remove deprecated headers related to joint constraints (stack-of-tasks/pinocchio#2382)

    ### Changed
    - Use eigenpy to expose `GeometryObject::meshMaterial` variant (stack-of-tasks/pinocchio#2315)
    - GepettoViewer is no more the default viewer for RobotWrapper (stack-of-tasks/pinocchio#2331)
    - Modernize python code base with ruff (stack-of-tasks/pinocchio#2367)
    - Restructure CppAD and CasADi examples (stack-of-tasks/pinocchio#2388)
    - Enhance and fix CppAD benchmarks outputs (stack-of-tasks/pinocchio#2393)

    ## [3.1.0] - 2024-07-04

    ### Fixed

    - Fix `appendModel` when joints after the base are in parallel (stack-of-tasks/pinocchio#2295)
    - Fix `appendModel` build when called with template arguments different than the ones from `context` (stack-of-tasks/pinocchio#2284)
    - Fix `TransformRevoleTpl::rotation` and `TransformHelicalTpl::rotation` build (stack-of-tasks/pinocchio#2284)
    - Fix compilation issue for Boost 1.85 (stack-of-tasks/pinocchio#2255)
    - Fix python bindings of `contactInverseDynamics` (stack-of-tasks/pinocchio#2263)
    - Deactivate `BUILD_WITH_LIBPYTHON` when building with PyPy (stack-of-tasks/pinocchio#2274)
    - Fix Python bindings cross building with `hpp-fcl` (stack-of-tasks/pinocchio#2288)
    - Fix build issue on Windows when a deprecated header is included (stack-of-tasks/pinocchio#2292)
    - Fix build issue on Windows when building in Debug mode (stack-of-tasks/pinocchio#2292)
    - Fix visualization of meshes in meshcat (stack-of-tasks/pinocchio#2294)
    - Fix Anymal simulation test (stack-of-tasks/pinocchio#2299)
    - Fix contact derivatives and impulse dynamics tests (stack-of-tasks/pinocchio#2300)
    - Fix CMake compatibility with old console_bridge version (stack-of-tasks/pinocchio#2312)

    ### Added

    - Python unittest for `contactInverseDynamics` function (stack-of-tasks/pinocchio#2263)
    - Added helper functions to return operation count of CasADi functions. (stack-of-tasks/pinocchio#2275)
    - C++ and Python unittest for `dIntegrateTransport` to check vector transport and its inverse (stack-of-tasks/pinocchio#2273)
    - Add kinetic and potential energy regressors (stack-of-tasks/pinocchio#2282)

    ### Removed

    - Remove header `list.hpp` include for bindings of model and rnea (stack-of-tasks/pinocchio#2263)

Packaging Changes:
- Removed patches af, an, ap: fixed upstream
- Updated patches ag, ak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants