-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pre-commit-config.yaml * Add pre-commit-config.yaml * code format * Add pre-commit action
- Loading branch information
Showing
17 changed files
with
400 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" | ||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to NuGet packages every week | ||
interval: "weekly" | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" | ||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to NuGet packages every week | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
pull_request: | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: false | ||
tags: wasontech/abb-robotraconteur-driver:latest | ||
name: Docker | ||
|
||
on: | ||
push: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: false | ||
tags: wasontech/abb-robotraconteur-driver:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: set up dotnet core 6.0 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: publish | ||
run: dotnet publish -c Release /p:Platform="Any CPU" --framework=net6.0 -o abb_robotraconteur_driver | ||
- name: copy license and readme | ||
run: | | ||
Copy-Item -Path LICENSE.txt -Destination abb_robotraconteur_driver | ||
Copy-Item -Path README.md -Destination abb_robotraconteur_driver | ||
- name: zip | ||
run: Compress-Archive -Path abb_robotraconteur_driver -DestinationPath abb_robotraconteur_driver.zip | ||
- name: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: abb_robotraconteur_driver | ||
path: abb_robotraconteur_driver.zip | ||
name: CI | ||
|
||
on: | ||
push: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: set up dotnet core 6.0 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: publish | ||
run: dotnet publish -c Release /p:Platform="Any CPU" --framework=net6.0 -o abb_robotraconteur_driver | ||
- name: copy license and readme | ||
run: | | ||
Copy-Item -Path LICENSE.txt -Destination abb_robotraconteur_driver | ||
Copy-Item -Path README.md -Destination abb_robotraconteur_driver | ||
- name: zip | ||
run: Compress-Archive -Path abb_robotraconteur_driver -DestinationPath abb_robotraconteur_driver.zip | ||
- name: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: abb_robotraconteur_driver | ||
path: abb_robotraconteur_driver.zip | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
SKIP: no-commit-to-branch | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- name: apt | ||
run: | | ||
sudo apt update | ||
sudo apt install -y dos2unix | ||
- name: Setup dotnet 6.x | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.x | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
exclude: ^(bin|obj|\.vs|\.vscode|TestResults|Generated_Code|generated_src)/.*$ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.5.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-yaml | ||
exclude: .clang-format | ||
args: ['--unsafe'] | ||
- id: check-ast | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
exclude: (^.*\.cs$|^.*\.csproj$|^.*\.sln$) | ||
- id: mixed-line-ending | ||
exclude: (^.*\.cs$|^.*\.csproj$|^.*\.sln$) | ||
- id: trailing-whitespace | ||
- id: fix-byte-order-marker | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-xml | ||
- id: detect-private-key | ||
- id: no-commit-to-branch | ||
args: ['--branch', 'master'] | ||
- id: forbid-submodules | ||
- repo: https://github.com/hhatto/autopep8 | ||
rev: v2.0.4 | ||
hooks: | ||
- id: autopep8 | ||
args: ["--ignore=E402", "-i", "--max-line-length=120"] | ||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.12.0 | ||
hooks: | ||
- id: pretty-format-yaml | ||
args: [--autofix, --indent, '2', '--preserve-quotes'] | ||
exclude: ^\.clang.*$ | ||
# - repo: https://github.com/efrecon/pre-commit-hook-lxml | ||
# rev: v0.1.1 | ||
# hooks: | ||
# - id: format-xml | ||
# exclude: ^.*\.svg$ | ||
- repo: local | ||
hooks: | ||
- id: dos2unix | ||
name: dos2unix | ||
entry: dos2unix | ||
args: ["-n", "-o"] | ||
files: '\.(c|cpp|h|hpp|java|i|m|cmake|txt|css|js|ts|html|md|txt|py|yaml|yml|rst|py\.in|)$' | ||
language: system | ||
- repo: local | ||
hooks: | ||
#Use dotnet format already installed on your machine | ||
- id: dotnet-format | ||
name: dotnet-format | ||
language: system | ||
entry: dotnet format --include | ||
types_or: ["c#", "vb"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
from RobotRaconteur.Client import * | ||
import time | ||
import numpy as np | ||
|
||
c = RRN.ConnectService('rr+tcp://localhost:58651?service=robot') | ||
|
||
robot_info = c.robot_info | ||
print(robot_info) | ||
|
||
print(c.robot_state.PeekInValue()[0].command_mode) | ||
|
||
robot_const = RRN.GetConstants("com.robotraconteur.robotics.robot", c) | ||
|
||
halt_mode = robot_const["RobotCommandMode"]["halt"] | ||
jog_mode = robot_const["RobotCommandMode"]["jog"] | ||
|
||
c.command_mode = halt_mode | ||
time.sleep(0.1) | ||
c.command_mode = jog_mode | ||
|
||
joint_diff = np.array([-5,0,0,0,0,5,0])*np.deg2rad(1) | ||
joint_vel = np.array([5.0,1,1,1,1,1]) | ||
|
||
for i in range(5): | ||
t = time.time() | ||
print("Begin move") | ||
c.jog_freespace(np.deg2rad([15,0,0,0,0,0]), joint_vel, True) | ||
print("done") | ||
time.sleep(0.5) | ||
print(hex(c.robot_state.PeekInValue()[0].robot_state_flags)) | ||
print("Begin move") | ||
c.jog_freespace(np.deg2rad([-15,0,0,0,0,0]), joint_vel, True) | ||
print("Done") | ||
print(hex(c.robot_state.PeekInValue()[0].robot_state_flags)) | ||
time.sleep(0.5) | ||
from RobotRaconteur.Client import * | ||
import time | ||
import numpy as np | ||
|
||
c = RRN.ConnectService('rr+tcp://localhost:58651?service=robot') | ||
|
||
robot_info = c.robot_info | ||
print(robot_info) | ||
|
||
print(c.robot_state.PeekInValue()[0].command_mode) | ||
|
||
robot_const = RRN.GetConstants("com.robotraconteur.robotics.robot", c) | ||
|
||
halt_mode = robot_const["RobotCommandMode"]["halt"] | ||
jog_mode = robot_const["RobotCommandMode"]["jog"] | ||
|
||
c.command_mode = halt_mode | ||
time.sleep(0.1) | ||
c.command_mode = jog_mode | ||
|
||
joint_diff = np.array([-5, 0, 0, 0, 0, 5, 0]) * np.deg2rad(1) | ||
joint_vel = np.array([5.0, 1, 1, 1, 1, 1]) | ||
|
||
for i in range(5): | ||
t = time.time() | ||
print("Begin move") | ||
c.jog_freespace(np.deg2rad([15, 0, 0, 0, 0, 0]), joint_vel, True) | ||
print("done") | ||
time.sleep(0.5) | ||
print(hex(c.robot_state.PeekInValue()[0].robot_state_flags)) | ||
print("Begin move") | ||
c.jog_freespace(np.deg2rad([-15, 0, 0, 0, 0, 0]), joint_vel, True) | ||
print("Done") | ||
print(hex(c.robot_state.PeekInValue()[0].robot_state_flags)) | ||
time.sleep(0.5) |
Oops, something went wrong.