Skip to content

Commit

Permalink
remove whitespace and update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
evelyd committed Jan 17, 2024
1 parent 3a4078b commit 776087b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project are documented in this file.

## [unreleased]
### Added
- Implement `velMANN` class to perform inference on MANN model with velocity-based features in `ML` component (https://github.com/ami-iit/bipedal-locomotion-framework/pull/795)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion src/ML/include/BipedalLocomotion/ML/velMANN.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ML
* orientation.
*/
struct velMANNInput
{
{
/** Matrix containing the base linear velocity trajectory. The rows contain the xyz linear velocity
* while the columns represent the velocity at each time instant. */
Eigen::Matrix3Xd baseLinearVelocityTrajectory;
Expand Down
2 changes: 1 addition & 1 deletion src/ML/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(BUILD_TESTING)
else()
set(VELMANN_ONNX_UPDATED FALSE)
endif()

if(NOT ${VELMANN_ONNX_UPDATED})
message(STATUS "Fetching velMANN onnx model from huggingface.co/ami-iit/mann...")
file(DOWNLOAD https://huggingface.co/ami-iit/mann/resolve/main/ergocubSN000_32j_149e_velbased_mann.onnx
Expand Down
50 changes: 25 additions & 25 deletions src/ML/tests/velMANNTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,46 @@ TEST_CASE("velMANN")
input.jointPositions.resize(32);
input.jointVelocities.resize(32);

std::array<double, 12 * 3> baseLinearVelTemp{3.5243694266353373e-15, 7.008199078189101e-15, 3.0614383132617574e-16, 0.012421162571032856,
std::array<double, 12 * 3> baseLinearVelTemp{3.5243694266353373e-15, 7.008199078189101e-15, 3.0614383132617574e-16, 0.012421162571032856,
-0.014122548398467332, -0.0017588395790161734, 0.0044019864826900425, -0.0032526431671412843,
-0.0003791446290885935, 0.0018464051771702283, -0.0007014617207248446, -0.0002852708574057455,
-0.007666416570001765, -0.006401494346322381, -0.0020622161550935647, -0.0019045289643069853,
-0.008158728689814406, 0.0006715067872605493, 0.0007060098803055911, -0.01477829078637679,
0.0011823591653468393, -0.0003210022438017331, 6.757567991447852e-06, 0.003540728250141397,
0.0, 0.0, 0.0, 0.017893397271105622,
-0.03658355242181092, 0.006983540281113693, 0.09451721426339721, -0.009889970586401762,
-0.008158728689814406, 0.0006715067872605493, 0.0007060098803055911, -0.01477829078637679,
0.0011823591653468393, -0.0003210022438017331, 6.757567991447852e-06, 0.003540728250141397,
0.0, 0.0, 0.0, 0.017893397271105622,
-0.03658355242181092, 0.006983540281113693, 0.09451721426339721, -0.009889970586401762,
0.008193869415440216, 0.2053173727694591, 0.07173449613753384, 0.009762607489653094};

input.baseLinearVelocityTrajectory = Eigen::Map<Eigen::MatrixXd>(baseLinearVelTemp.data(), 3, 12);

std::array<double, 12 * 3> baseAngularVelTemp{1.2839528469302477e-16, 1.9898256768176927e-17, 6.762609578082937e-18, 0.031449943566089156,
0.07414012486813136, 0.07208904404786341, 0.006826734024380377, 0.050238738599215724,
0.0016967450914463823, 0.004713732379144265, 0.019225556089882915, -0.008454823733790681,
0.019126096353924676, -0.03700523273782162, 0.02385417785340806, 0.007936443095453556,
-0.005759098538862559, 0.016742656763119815, 0.00818785217095963, -0.037435052638151126,
-0.016759287151117987, 0.05256457282727177, -0.03841732944090507, -0.10431413289643675,
std::array<double, 12 * 3> baseAngularVelTemp{1.2839528469302477e-16, 1.9898256768176927e-17, 6.762609578082937e-18, 0.031449943566089156,
0.07414012486813136, 0.07208904404786341, 0.006826734024380377, 0.050238738599215724,
0.0016967450914463823, 0.004713732379144265, 0.019225556089882915, -0.008454823733790681,
0.019126096353924676, -0.03700523273782162, 0.02385417785340806, 0.007936443095453556,
-0.005759098538862559, 0.016742656763119815, 0.00818785217095963, -0.037435052638151126,
-0.016759287151117987, 0.05256457282727177, -0.03841732944090507, -0.10431413289643675,
0.0, 0.0, 0.0, 0.0878491471703012,
-0.12733981016516405, -0.2832203614502011, 0.03918120592226204, 0.0804221698146093,
-0.43534358315740246, -0.09585916148288552, 0.15195461008141126, -0.6545870342808059};
input.baseAngularVelocityTrajectory
= Eigen::Map<Eigen::MatrixXd>(baseAngularVelTemp.data(), 3, 12);

input.jointPositions << -0.08914329577232137, 0.025767620112200747, 0.016600125582731447, -0.10205569019576242,
-0.10115357046332556, -0.02590094449134414, -0.10954097755732813, -0.021888724926318617,
0.06819316643211669, -0.07852679097651347, -0.10034170556770548, 0.020710812052444683,
0.2413038455611485, 0.010535350226309968, 0.006275324178053386, -0.14908520025814864,
0.08533421586871431, 0.10281322318047023, 0.32297257397277707, 0.14790247588361516,
-0.3129451427487485, 0.04242320961879248, 0.0022412263648723028, -0.016729676987423055,
0.11047971812597632, -0.12993538373842523, 0.018668904587540704, 0.033567343049341246,
input.jointPositions << -0.08914329577232137, 0.025767620112200747, 0.016600125582731447, -0.10205569019576242,
-0.10115357046332556, -0.02590094449134414, -0.10954097755732813, -0.021888724926318617,
0.06819316643211669, -0.07852679097651347, -0.10034170556770548, 0.020710812052444683,
0.2413038455611485, 0.010535350226309968, 0.006275324178053386, -0.14908520025814864,
0.08533421586871431, 0.10281322318047023, 0.32297257397277707, 0.14790247588361516,
-0.3129451427487485, 0.04242320961879248, 0.0022412263648723028, -0.016729676987423055,
0.11047971812597632, -0.12993538373842523, 0.018668904587540704, 0.033567343049341246,
0.3631242921725555, -0.28302209132906536, -0.3129451427487485, 0.04242320961879248;

input.jointVelocities << 0.018265725998252436, -0.0035976586400216642, -0.012043915220395253, -0.010850374465225243,
-0.0029826472872050702, 0.01194233827184095, 0.00894458674770629, 0.003558151484858718,
0.01579702497265592, -0.0028171693990643176, -0.001904114327552775, -0.011985210234407781,
0.020805414325628102, 0.011839621139096701, 0.009719580928183296, 0.01040432230648286,
0.03174781826678491, -0.07732321906598477, -0.051694399002594205, 0.015153131453655988,
8.599305395817769e-05, -1.1664542210951256e-05, 0.005543033652851423, 0.0010366246463409945,
-0.01100933606651422, -0.041149377276150645, -0.0024410871334947654, -0.04243541029015849,
input.jointVelocities << 0.018265725998252436, -0.0035976586400216642, -0.012043915220395253, -0.010850374465225243,
-0.0029826472872050702, 0.01194233827184095, 0.00894458674770629, 0.003558151484858718,
0.01579702497265592, -0.0028171693990643176, -0.001904114327552775, -0.011985210234407781,
0.020805414325628102, 0.011839621139096701, 0.009719580928183296, 0.01040432230648286,
0.03174781826678491, -0.07732321906598477, -0.051694399002594205, 0.015153131453655988,
8.599305395817769e-05, -1.1664542210951256e-05, 0.005543033652851423, 0.0010366246463409945,
-0.01100933606651422, -0.041149377276150645, -0.0024410871334947654, -0.04243541029015849,
0.01042528371749396, 0.0009363820684421542, 8.599305395817769e-05, -1.1664542210951256e-05;

REQUIRE(velMann.setInput(input));
Expand Down

0 comments on commit 776087b

Please sign in to comment.