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

Non lfs picknik_accessories #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ This workspace contains reference materials for using MoveIt Pro, including:
- [Mobile manipulation configuration](src/moveit_pro_mobile_manipulation/picknik_ur_mobile_config)
- [Example behaviors](src/example_behaviors)

Since the [picknik_accessories](https://github.com/PickNikRobotics/picknik_accessories) package uses git LFS, [it cannot be added as a subtree](https://github.com/git-lfs/git-lfs/issues/854).
Please ensure you have the submodule up to date using:
```bash
git submodule update --recursive --init
```

## Working with Git Subtrees

Expand Down Expand Up @@ -43,7 +38,7 @@ The structure of this repository is as follows:
│ ├── mobile_manipulation_config
│ └── picknik_ur_mobile_config
├── <a href="https://github.com/PickNikRobotics/fanuc_sim">fanuc_sim</a>
├── <a href="https://github.com/PickNikRobotics/picknik_accessories">picknik_accessories</a> (submodule)
├── <a href="https://github.com/PickNikRobotics/picknik_accessories_non_lfs">picknik_accessories</a>
└── external_dependencies
├── <a href="https://github.com/sjahr/ridgeback/tree/ros2">ridgeback</a>
├── <a href="https://github.com/PickNikRobotics/ros2_robotiq_gripper">ros2_robotiq_gripper</a>
Expand Down
1 change: 0 additions & 1 deletion src/picknik_accessories
Submodule picknik_accessories deleted from c9b1e7
72 changes: 72 additions & 0 deletions src/picknik_accessories/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
args: ["--unsafe"] # Fixes errors parsing custom YAML constructors like ur_description's !degrees
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: fix-byte-order-marker

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
- id: codespell
args: ["--write-changes", "-L", "atleast,inout,ether"] # Provide a comma-separated list of misspelled words that codespell should ignore (for example: '-L', 'word1,word2,word3').
exclude: (\.(svg|pyc|stl|dae|asc)|pnpm-lock.yaml)$

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|proto|vert)$
# -i arg is included by default by the hook
args: ["-fallback-style=none"]

- repo: https://github.com/adrienverge/yamllint
rev: v1.27.1
hooks:
- id: yamllint
args:
[
"--no-warnings",
"--config-data",
"{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}}}",
]
types: [text]
files: \.(yml|yaml)$

- repo: https://github.com/tcort/markdown-link-check
rev: v3.10.3
hooks:
- id: markdown-link-check

- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
23 changes: 23 additions & 0 deletions src/picknik_accessories/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.22)
project(picknik_accessories)

find_package(ament_cmake REQUIRED)

install(
DIRECTORY
descriptions
macros
mujoco_assets
DESTINATION
share/${PROJECT_NAME}
)
# TODO: is this lint process hanging somehow?
# if(BUILD_TESTING)
# find_package(ament_lint_auto REQUIRED)
# ament_lint_auto_find_test_dependencies()
# endif()

ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in")


ament_package()
29 changes: 29 additions & 0 deletions src/picknik_accessories/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2024 PickNik Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
75 changes: 75 additions & 0 deletions src/picknik_accessories/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# PickNik Accessories

PickNik assets for common objects and attachments.

# Using MuJoCo assets:

The `mujoco_assets` folder in this package can be used in any `picknik_mujoco_ros/MujocoSystem` based simulation using the `include` tag in MuJoCo XML.
Since MuJoCo XML files all assume that included files are relative to the main XML file (the `mujoco_model` parameter set as part of the `ros2_control` entry in your robot description), shared assets must be moved to the same directory as the top level XML file.
To achieve this without duplicating assets, we can place symlinks in the install directory of your package that point back to the `mujoco_assets` folder of this package.
Add the following to your CMakeLists.txt to add symlinks to this package's assets:

```
# Install all XML files in directory
set(PICKNIK_ACCESSORIES_SHARE_DIR
"${CMAKE_INSTALL_PREFIX}/../picknik_accessories/share/picknik_accessories/mujoco_assets/"
)
# Destination directory
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/description/")

install(DIRECTORY "${PICKNIK_ACCESSORIES_SHARE_DIR}"
DESTINATION "${DEST_DIR}"
FILES_MATCHING PATTERN "*")
```

Alternatively, if some files in this package conflict with files in your workspace, you can choose specific files to symlink:

```
# Install individual XML files
set(PICKNIK_ACCESSORIES_SHARE_DIR
"${CMAKE_INSTALL_PREFIX}/../picknik_accessories/share/picknik_accessories/mujoco_assets/"
)
# Destination directory
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/description/")

set(EXTERNAL_XML_FILES
"${PICKNIK_ACCESSORIES_SHARE_DIR}/ur5e/ur5e_globals.xml"
"${PICKNIK_ACCESSORIES_SHARE_DIR}/ur5e/ur5e.xml"
# Add additional files here if desired
)
foreach(xml_file IN LISTS EXTERNAL_XML_FILES)
install(FILES "${xml_file}"
DESTINATION "${DEST_DIR}"
)
endforeach()
```

Whether you chose to install all assets or just a selection, the above CMake code will merge the contents of `picknik_accessories/mujoco_assets/` with `your_package_name/description/` in the install folder, so that XML files in the `picknik_accessories` package can be included as if they were within your package.

# UR5e Example

Below is a minimal example using the UR5e asset:

```
<mujoco model="ur5e scene">
<include file="ur5e/ur5e_globals.xml" />

<worldbody>
<light pos="0 0 1.5" dir="0 0 -1" directional="true" />

<geom
name="floor"
pos="0 0 0"
size="0 0 0.05"
type="plane"
material="groundplane"
/>

<include file="ur5e/ur5e.xml" />
</worldbody>

</mujoco>
```

Note: Since you cannot define global properties within a `worldbody` tag, the assets must be divided in to two XML files.
The `ur5e_globals.xml` file contains properties that must be defined as global properties outside `worldbody` (like `default` and `actuator`), while the `ur5e.xml` contains only `body` tags (and XML tags that are allowed within a `body`).
3 changes: 3 additions & 0 deletions src/picknik_accessories/blender/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Folder for maintaining Blender source files for various scene descriptions.

This folder should NOT be included in this package's build, as these files should not be included in binary Docker images.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions src/picknik_accessories/blender/picknik_ur_mock_hw_config/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading