-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add pixi support to build and run IMU test #71
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bcaa015
Add pixi support to build and run IMU test
martinaxgloria d6c7a45
Update documentation
martinaxgloria 736e4f4
Set ENV variables in set_path.sh activation file
martinaxgloria 180cc4a
Prepend CONDA_PREFIX to the CMAKE_PREFIX_PATH env
martinaxgloria 371bd13
Add the documentation to run the test with pixi
martinaxgloria 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 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,3 @@ | ||
# GitHub syntax highlighting | ||
pixi.lock linguist-language=YAML | ||
|
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 |
---|---|---|
|
@@ -4,4 +4,7 @@ build | |
CMakeLists.txt.user | ||
result.txt | ||
.DS_Store | ||
.vscode | ||
.vscode | ||
.pixi* | ||
.build* | ||
*.mat |
Large diffs are not rendered by default.
Oops, something went wrong.
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,26 @@ | ||
[project] | ||
name = "icub-tests" | ||
version = "0.0.0" | ||
description = "Set of tests to check the functionalities of a robot" | ||
authors = ["Martina Gloria <[email protected]>"] | ||
channels = ["conda-forge", "robotology"] | ||
platforms = ["linux-64", "win-64", "osx-64"] | ||
|
||
[activation] | ||
scripts = ["set_path.sh"] | ||
|
||
[tasks] | ||
build_imu_test = {cmd = "cmake -DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX -S. -B.build -DICUB_TESTS_COMPILES_IMU_TEST=ON"} | ||
compile_imu_test = {cmd = "cmake --build .build", depends_on = ["build_imu_test"]} | ||
install_imu_test = {cmd = "cmake --install .build", depends_on = ["compile_imu_test"]} | ||
imu_sim_test = {cmd = "robottestingframework-testrunner --verbose --suite suites/imu-icubGazeboSim.xml", depends_on = ["install_imu_test"]} | ||
imu_test = {cmd = "robottestingframework-testrunner --verbose --suite suites/imu.xml", depends_on = ["install_imu_test"]} | ||
|
||
[dependencies] | ||
robometry = "*" | ||
idyntree = "*" | ||
yarp = "*" | ||
robot-testing-framework = "*" | ||
icub-main = "*" | ||
icub-models = "*" | ||
robotology-distro = ">=2024.2.0,<2024.3" |
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,4 @@ | ||
export CMAKE_INSTALL_PREFIX=$CONDA_PREFIX | ||
export YARP_DATA_DIRS=$CMAKE_INSTALL_PREFIX/share/yarp:$CMAKE_INSTALL_PREFIX/share/iCub:$PIXI_PROJECT_ROOT/suites | ||
export LD_LIBRARY_PATH=$CMAKE_INSTALL_PREFIX/lib/robottestingframework:$PIXI_PROJECT_ROOT/.build/plugins | ||
export CMAKE_PREFIX_PATH=$CONDA_PREFIX |
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,95 @@ | ||
IMU orientation test | ||
==================== | ||
|
||
## Prerequisites | ||
|
||
If you want to test multiple IMUs at once, the robot must expose in its `yarprobotinterface` configuration file a `multipleanalogsensorsserver` that publishes the orientation measurements for all of available sensors, with a `prefix` that matches exactly the `port` parameter of the test (the default one is `${portprefix}/alljoints/inertials`). | ||
|
||
An example of `alljoints-inertials_wrapper.xml` for iCubV2_* models: | ||
|
||
```sh | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd"> | ||
|
||
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="alljoints-inertials_wrapper" type="multipleanalogsensorsserver"> | ||
<param name="period"> 10 </param> | ||
<param name="name"> ${portprefix}/alljoints/inertials </param> | ||
|
||
<action phase="startup" level="10" type="attach"> | ||
<paramlist name="networks"> | ||
<elem name="FirstStrain"> alljoints-inertials_remapper </elem> | ||
</paramlist> | ||
</action> | ||
|
||
<action phase="shutdown" level="15" type="detach" /> | ||
</device> | ||
``` | ||
|
||
and `alljoints-inertials_remapper.xml`: | ||
|
||
```sh | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd"> | ||
|
||
|
||
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="alljoints-inertials_remapper" type="multipleanalogsensorsremapper"> | ||
<param name="OrientationSensorsNames"> | ||
(l_arm_ft r_arm_ft head_imu_0) | ||
</param> | ||
<action phase="startup" level="5" type="attach"> | ||
<paramlist name="networks"> | ||
<elem name="head_imu"> head_inertial_hardware_device </elem> | ||
<elem name="left_arm_imu"> left_arm_inertial_hardware_device </elem> | ||
<elem name="right_arm_imu"> right_arm_inertial_hardware_device </elem> | ||
</paramlist> | ||
</action> | ||
|
||
<action phase="shutdown" level="20" type="detach" /> | ||
</device> | ||
|
||
``` | ||
|
||
## Usage | ||
|
||
There are essentially two methods to install and run the IMU orientation test, which are going to be described in the following sections. In both cases, after launching the test, a .mat file containing the relevant measurements involved in the test will be generated. | ||
|
||
### robotology-superbuild | ||
|
||
If you have installed `icub-tests` as a part of the `robotology superbuild` framework with the [Robot Testing profile](https://github.com/robotology/robotology-superbuild/blob/master/doc/cmake-options.md#robot-testing) activation, i.e. by enabling the `ROBOTOLOGY_ENABLE_ROBOT_TESTING` CMake option of the superbuild, this test, like the others, is already available. | ||
|
||
In this case, after compiling and being sure that `yarpserver` is up, you can run: | ||
|
||
```sh | ||
cd robotology-superbuild/src/icub-tests | ||
robottestingframework-testrunner --suite suites/imu.xml | ||
``` | ||
|
||
Otherwise, if you want to launch the test in a simulation environment, in a shell open a `gazebo` environment and import, for example, your iCub model. After that, open a separated shell, and: | ||
|
||
```sh | ||
#set YARP_ROBOT_NAME env variable with the name of the model you imported in gazebo | ||
#example: | ||
export YARP_ROBOT_NAME=iCubGazeboV2_7 | ||
cd robotology-superbuild/src/icub-tests | ||
robottestingframework-testrunner --suite suites/imu-icubGazeboSim.xml | ||
``` | ||
|
||
### pixi | ||
|
||
If you want to run the test without depending on the whole robotology-superbuild, you can use `pixi`. First of all, be sure to have [`pixi`](https://pixi.sh/#installation) installed. Then, clone `icub-tests` and run the test as a pixi task: | ||
|
||
```sh | ||
git clone https://github.com/robotology/icub-tests | ||
cd icub-tests | ||
pixi run imu_test | ||
``` | ||
|
||
In simulation, instead, import your model in `gazebo` and then run: | ||
|
||
```sh | ||
#set YARP_ROBOT_NAME env variable with the name of the model you imported in gazebo | ||
#example: | ||
export YARP_ROBOT_NAME=iCubGazeboV2_7 | ||
cd icub-tests | ||
pixi run imu_sim_test | ||
``` |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the configuration file https://github.com/robotology/icub-tests/blob/devel/suites/contexts/icub/test_imu.ini#L3, it seems that the test requires the existence of the
multipleanalogsensorsserver
with prefix/${robotname}/alljoints/inertials
. Which robots expose this functionality? It could make sense to either list the robots that expose this functionality, or if that is too complicated from the maintenance point of view, just explicitly mention that the robot needs to expose amultipleanalogsensorsserver
device with prefix/${robotname}/alljoints/inertials
in itsyarprobotinterface
config files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, no robots exposed this functionality upstream but I'm going to do this at least for
iCubGenova11
and foriCubGazeboV2_*
models I guess. We could use them as references to highlight in the documentation that is mandatory to have this MASserver exposed with that port name. Thanks @traversaro!