-
Notifications
You must be signed in to change notification settings - Fork 17
nix: add flake #26
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
Open
gwennlbh
wants to merge
33
commits into
open-dynamic-robot-initiative:main
Choose a base branch
from
gwennlbh:nix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
nix: add flake #26
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
bea4e06
nix: add flake
gwennlbh d74325d
nix: update sdk package name reference
gwennlbh 7e4022a
nix: don't use submodules
gwennlbh 641e483
nix: update after d5d6105f8db1770cd07fdde300c4c008e36de818 on master-…
gwennlbh 7c703ac
ci: add nix build
gwennlbh 22da2e3
ci: enable logs for nix build
gwennlbh 1ca239e
nix: get package version dynamically
gwennlbh 5587444
nix: update flake.lock
gwennlbh c556f6e
ci: enforce flake.lock correctness
gwennlbh ba65ab1
nix: set yaml-cpp as propagated build input
gwennlbh 16d0409
nix: use gepetto/nix and flake template
gwennlbh c026c2b
factor out paths to demo config files
gwennlbh 53f94a0
bake demo configs into binary
gwennlbh 214ab9c
Revert "bake demo configs into binary"
gwennlbh af04179
git: gitignore a bunch of things
gwennlbh 1089c8a
nix: update flake lock
gwennlbh 62b8661
nix: add solo12 app to flake
gwennlbh 61f89f5
nix: fmt
gwennlbh 307c7e6
ci: run nix flake check instead of nix build
gwennlbh 1a3dde8
fix demo config paths handling
gwennlbh 0e800d1
nix: add a devshell to run demos/ .py scripts
gwennlbh 8a90dca
nix: reference gepetto/nix instead of my fork
gwennlbh 4b8ec15
use PYTHONPATH instead of a shellhook
gwennlbh d8ac492
ci: use gepetto cachix
gwennlbh c186238
gitignore: revert cmake-related ignores
gwennlbh bdd68a0
nix: tidy up flake apps' program decls
gwennlbh ef06648
ci: run on macos too
gwennlbh 2424998
nix: fix pname for PYTHONPATH
gwennlbh bc6321f
ci: only prevent lockfile changes on ubuntu
gwennlbh 36e6bb2
ci: dedupe job creation
gwennlbh 884d94c
nix: fix path to apps' program
gwennlbh 9d9ff5f
maybe fix demo testbench
gwennlbh 1137873
add python testbench demo
gwennlbh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,29 @@ | ||
name: CI - Nix | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
CI: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
name: CI (${{ matrix.os }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v30 | ||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: gepetto | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: nix flake check -L | ||
- name: Check if there are changes | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: NathanielHill/[email protected] |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
*build* | ||
|
||
*.user | ||
*.code-workspace | ||
result | ||
.vscode/c_cpp_properties.json |
This file contains hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
import numpy as np | ||
|
||
np.set_printoptions(suppress=True, precision=2) | ||
|
||
import libodri_control_interface_pywrap as oci | ||
|
||
robot = oci.robot_from_yaml_file("config_testbench.yaml") | ||
|
||
des_pos = np.array([np.pi / 2, -np.pi / 2]) | ||
|
||
robot.initialize(des_pos) | ||
|
||
kp, kd = 0.125, 0.0025 | ||
c = 0 | ||
while not robot.is_timeout: | ||
robot.parse_sensor_data() | ||
|
||
positions = robot.joints.positions | ||
velocities = robot.joints.velocities | ||
|
||
# Compute the PD control on the zero position. | ||
torques = kp * (des_pos - positions) - kd * velocities | ||
|
||
robot.joints.set_torques(torques) | ||
robot.send_command_and_wait_end_of_cycle(0.001) | ||
|
||
c += 1 | ||
|
||
if c % 1000 == 0: | ||
print("joint pos: ", positions) | ||
print("joint vel: ", velocities) | ||
print("torques: ", torques) | ||
robot.robot_interface.PrintStats() | ||
|
||
print("timeout detected") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.