Skip to content

Commit

Permalink
Release 0.5.2
Browse files Browse the repository at this point in the history
AIRO-1696
  • Loading branch information
hyounesy authored Feb 2, 2022
2 parents e9859c4 + 58791f8 commit 90f353e
Show file tree
Hide file tree
Showing 23 changed files with 484 additions and 114 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/jira-link.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: jira-link

on:
pull_request:
types: [opened, edited, reopened, synchronize]

jobs:
jira-link:
runs-on: ubuntu-20.04
steps:
- name: check pull request title and source branch name
run: |
echo "Checking pull request with title ${{ github.event.pull_request.title }} from source branch ${{ github.event.pull_request.head.ref }}"
if ! [[ "${{ github.event.pull_request.title }}" =~ ^AIRO-[0-9]+[[:space:]].*$ ]] && ! [[ "${{ github.event.pull_request.head.ref }}" =~ ^AIRO-[0-9]+.*$ ]]
then
echo -e "Please make sure one of the following is true:\n \
1. the pull request title starts with 'AIRO-xxxx ', e.g. 'AIRO-1024 My Pull Request'\n \
2. the source branch starts with 'AIRO-xxx', e.g. 'AIRO-1024-my-branch'"
exit 1
else
echo "Completed checking"
fi
27 changes: 27 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Stale issue handler'
on:
workflow_dispatch:
schedule:
- cron: '0 17 * * *' # 17:00 UTC; 10:00 PDT

permissions:
issues: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4.0.0
id: stale
with:
stale-issue-label: 'stale'
stale-issue-message: 'This issue has been marked stale because it has been open for 14 days with no activity. Please remove the stale label or comment on this issue, or the issue will be automatically closed in the next 14 days.'
days-before-stale: 14
days-before-pr-stale: -1
days-before-close: 14
days-before-pr-close: -1
exempt-issue-labels: 'blocked,must,should,keep,pinned,work-in-progress,request,announcement'
close-issue-message: 'This issue has been marked stale for 14 days and will now be closed. If this issue is still valid, please ping a maintainer.'
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Rider cache directory
.idea

# Visual Studio cache directory
.vs/

Expand Down Expand Up @@ -73,3 +76,7 @@ crashlytics-build.properties

# .DS_Store
**/.DS_Store

# Sonarqube
.scannerwork/**
.sonarqube/**
33 changes: 33 additions & 0 deletions .yamato/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Sonarqube Scan
agent:
type: Unity::metal::macmini
image: package-ci/mac
flavor: m1.mac
variables:
PROJECT_PATH: TestUrdfImporter
SONARQUBE_PROJECT_KEY: ai-robotics-urdf-importer
SONARQUBE_PROJECT_BASE_DIR: /Users/bokken/build/output/Unity-Technologies/URDF-Importer/com.unity.robotics.urdf-importer
MSBUILD_SLN_PATH: ./TestUrdfImporter/TestUrdfImporter.sln
UNITY_VERSION: 2020.3.11f1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
- unity-downloader-cli -u $UNITY_VERSION -c Editor
- brew install mono corretto
- curl https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.2.1.31210/sonar-scanner-msbuild-5.2.1.31210-net46.zip -o sonar-scanner-msbuild-net46.zip -L
- unzip sonar-scanner-msbuild-net46.zip -d ~
- chmod a+x ~/sonar-scanner-4.6.1.2450/bin/sonar-scanner
- .Editor/Unity.app/Contents/MacOS/Unity -projectPath $PROJECT_PATH -batchmode -quit -nographics -logFile - -executeMethod "UnityEditor.SyncVS.SyncSolution"
- command: |
cd $PROJECT_PATH
for file in *.csproj; do sed -i.backup "s/^[[:blank:]]*<ReferenceOutputAssembly>false<\/ReferenceOutputAssembly>/<ReferenceOutputAssembly>true<\/ReferenceOutputAssembly>/g" $file; rm $file.backup; done
cd ../
- mono ~/SonarScanner.MSBuild.exe begin /k:$SONARQUBE_PROJECT_KEY /d:sonar.host.url=$SONARQUBE_ENDPOINT_URL_PRD /d:sonar.login=$SONARQUBE_TOKEN_PRD /d:sonar.projectBaseDir=$SONARQUBE_PROJECT_BASE_DIR
- msbuild $MSBUILD_SLN_PATH
- mono ~/SonarScanner.MSBuild.exe end /d:sonar.login=$SONARQUBE_TOKEN_PRD
triggers:
cancel_old_ci: true
expression: |
((pull_request.target eq "main" OR pull_request.target eq "dev")
AND NOT pull_request.push.changes.all match "**/*.md") OR
(push.branch eq "main" OR push.branch eq "dev")
14 changes: 8 additions & 6 deletions .yamato/yamato-config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: URDF Importer Unit Tests
agent:
type: Unity::VM
image: robotics/ci-ubuntu20:latest
image: robotics/ci-ubuntu20:v0.1.0-795910
flavor: i1.large
variables:
COVERAGE_EXPECTED: 35
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
commands:
- git submodule update --init --recursive
Expand All @@ -15,14 +16,15 @@ commands:
- command: |
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
echo "Line coverage: $linecoverage%"
if (( $(echo "$linecoverage < 20" | bc -l) )); then exit 1; fi
if (( $(echo "$linecoverage < $COVERAGE_EXPECTED" | bc -l) ))
then echo "ERROR: Code coverage is under threshold of $COVERAGE_EXPECTED%" && exit 1
fi
triggers:
cancel_old_ci: true
expression: |
(pull_request.target eq "main" AND
NOT pull_request.push.changes.all match "**/*.md") OR
(pull_request.target eq "dev" AND
NOT pull_request.push.changes.all match "**/*.md")
((pull_request.target eq "main" OR pull_request.target eq "dev")
AND NOT pull_request.push.changes.all match "**/*.md") OR
(push.branch eq "main" OR push.branch eq "dev")
artifacts:
logs:
paths:
Expand Down
24 changes: 15 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,30 @@ does the following:
- Has corresponding changes to documentation, unit tests and sample environments (if
applicable)
- Contains a summary of the tests performed to validate your changes
- Updates the [Changelog](com.unity.robotics.urdf-importer/CHANGELOG.md) and describes changes in the Unreleased section
- Links to issue numbers that the PR resolves (if any)

## Workflow

This project is provided as a package to be imported into a Unity project. In order to avoid common issues regarding version control and unmanaged files, the suggested workflow for contributing to the package is as follows:

1. Clone this repository to a known location on your local machine (e.g. Documents).
2. Git checkout the `dev` branch to ensure you have the latest staged changes.
3. In a development Unity project (e.g. a new project created from the Unity Hub of the minimum Unity [version](README.md) or above), open the `Window > Package Manager`.
4. Click the `+` in the top-left of the Package Manager window and select `Add package from disk...`.
5. Navigate to the cloned repository, and select the `com.unity.<package>/package.json` file. Click `Open`.
6. The local version of the package is now added to your Unity project! Changes made to your cloned directory will update in your Unity project.

<!-- ## Continuous Integration (CI)
We run continuous integration on all PRs; all tests must be passing before the PR is merged. -->

## Code style

All Python code should follow the [PEP 8 style guidelines](https://pep8.org/).

All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
Additionally, the [Unity Coding package](https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html)
can be used to format, encode, and lint your code according to the standard Unity
development conventions. Be aware that these Unity conventions will supersede the
Microsoft C# Coding Conventions where applicable.
All C# code should follow the [Microsoft C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions). (Code may be reformatted to Unity coding standards where applicable.)

Please note that even if the code you are changing does not adhere to these guidelines,
we expect your submissions to follow these conventions.
Please note that even if the code you are changing does not follow these conventions,
we expect your submissions to do so.

## Contributor License Agreements

Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@
[![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE.md)
![Unity](https://img.shields.io/badge/unity-2020.2+-brightgreen)

---

We're currently working on lots of things! Please take a short moment fill out our [survey](https://unitysoftware.co1.qualtrics.com/jfe/form/SV_0ojVkDVW0nNrHkW) to help us identify what products and packages to build next.

---

## Introduction

URDF Importer allows you to import a robot defined in [URDF](http://wiki.ros.org/urdf/XML) format in a Unity scene. URDF defines the geometry, visual meshes, kinematic and dynamic attributes of a Robot. Importer parses a URDF file and imports it into Unity using PhyX 4.0 articulation bodies.

# Using the Package
## Using the Package

## Adding the URDF package
### Adding the URDF package

1. Open the Package Manager from Unity Menu. Click `Window -> Package Manager`. A new package manager window will appear.

2. Click on the `+` sign on the top left corner of the package manager window and click on `Add Package from Git URL`.

<img src = "images~/Package_manager_add.png">

3. Enter the git URL for the URDF Importer with the latest version tag (currently v0.5.0) `https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#v0.5.0` in the text box and press `Enter`.
3. Enter the git URL for the URDF Importer with the latest version tag (currently v0.5.2) `https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#v0.5.2` in the text box and press `Enter`.

4. Click `Import URDF`.

## Importing the robot using URDF file
### Importing the robot using URDF file

1. Copy the URDF and the associated files in the assets folder in the Project window. Make sure the [location](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/urdf_importer/urdf_appendix.md#file-hierarchy) of the mesh files is correct.

Expand All @@ -35,7 +43,7 @@ URDF Importer allows you to import a robot defined in [URDF](http://wiki.ros.org
4. Click `Import URDF`


# Tutorials
## Tutorials

Instructions for using URDF importer can be found [here](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/urdf_importer/urdf_tutorial.md).

Expand Down
32 changes: 32 additions & 0 deletions com.unity.robotics.urdf-importer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

### Fixed


## [0.5.2-preview] - 2022-02-01

Added Sonarqube scanner

### Fixed
Fixed inability to read relative file paths

Correct Axis change issues in URDF Importer


## [0.5.1-preview] - 2021-10-04
Fixed bug with multiple references to the same mesh during import

Add the [Close Stale Issues](https://github.com/marketplace/actions/close-stale-issues) action

### Upgrade Notes

### Known Issues

### Added

Start supporting file:// type URI.

### Changed

### Deprecated

### Removed

### Fixed

## [0.5.0-preview] - 2021-07-15

### Upgrade Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You may obtain a copy of the License at
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
*/

using System.IO;
using UnityEditor;
Expand All @@ -28,7 +28,7 @@ public class UrdfRobotEditor : UnityEditor.Editor

public void OnEnable()
{
axisType = serializedObject.FindProperty("choosenAxis");
axisType = serializedObject.FindProperty("chosenAxis");
}
public override void OnInspectorGUI()
{
Expand All @@ -37,10 +37,6 @@ public override void OnInspectorGUI()

urdfRobot = (UrdfRobot) target;

EditorGUILayout.PropertyField(axisType, new GUIContent("Axis Type"));
serializedObject.ApplyModifiedProperties();
UrdfRobotExtensions.CorrectAxis(urdfRobot.gameObject);

GUILayout.Space(5);
GUILayout.Label("All Rigidbodies", EditorStyles.boldLabel);
DisplaySettingsToggle(new GUIContent("Use Gravity", "If disabled, robot is not affected by gravity."), urdfRobot.SetRigidbodiesUseGravity, UrdfRobot.useGravity);
Expand All @@ -61,9 +57,12 @@ public override void OnInspectorGUI()
EditorGUILayout.EndHorizontal();

GUILayout.Space(5);
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(axisType, new GUIContent("Axis Type", "Adjust this if the models that make up your robot are facing the wrong direction."));
serializedObject.ApplyModifiedProperties();
UrdfRobotExtensions.CorrectAxis(urdfRobot.gameObject);
EditorGUI.EndDisabledGroup();
// Legacy code for correcting axis in the inspector
// serializedObject.ApplyModifiedProperties();
// UrdfRobotExtensions.CorrectAxis(urdfRobot.gameObject);

if (urdfRobot.GetComponent<Unity.Robotics.UrdfImporter.Control.Controller>() == null || urdfRobot.GetComponent<Unity.Robotics.UrdfImporter.Control.FKRobot>() == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ private void OnGUI()
//Select the original up axis of the imported mesh
GUILayout.Space(5);
EditorGUILayout.BeginHorizontal();
settings.choosenAxis = (ImportSettings.axisType)EditorGUILayout.EnumPopup(
"Select Axis Type" , settings.choosenAxis);
settings.chosenAxis = (ImportSettings.axisType)EditorGUILayout.EnumPopup(
"Select Axis Type" , settings.chosenAxis);
EditorGUILayout.EndHorizontal();

//Window title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static T FindUrdfAsset<T>(string urdfFileName) where T : UnityEngine.Obje
var originalUrdfPath = UrdfAssetPathHandler.GetRelativeAssetPathFromUrdfPath(urdfFileName, false);
if (originalUrdfPath.ToLower().EndsWith(".stl"))
{// it is an asset that requires post processing
if (UrdfRobotExtensions.importsettings.OverwriteExistingPrefabs || !RuntimeUrdf.AssetExists(fileAssetPath, true))
if ((UrdfRobotExtensions.importsettings.OverwriteExistingPrefabs || !RuntimeUrdf.AssetExists(fileAssetPath, true)) && !UrdfGeometryCollision.UsedTemplateFiles.Contains(Path.GetFileNameWithoutExtension(fileAssetPath)))
{// post process again to (re)create prefabs
StlAssetPostProcessor.PostprocessStlFile(originalUrdfPath);
}
Expand Down
Loading

0 comments on commit 90f353e

Please sign in to comment.