-
Notifications
You must be signed in to change notification settings - Fork 2
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 test for forcetorque plugin #30
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5589283
FT test
lucapa17 374f667
Create README.md
lucapa17 f01adbc
changes in CMakeLists files
lucapa17 dbcc747
Merge branch 'main' into FT-tests
lucapa17 3d7a04e
set env variable GZ_SIM_SYSTEM_PLUGIN_PATH in CMakeList file for FT test
lucapa17 9f4a0ec
use multipleanalogsensorsclient instead of yarp port for test
lucapa17 222a77c
add YARP_DATA_DIRS
GiacomoBisio fd28795
increase timeout and running time
GiacomoBisio 6697372
Fix use of cache in apt workflow
traversaro 2864978
Update apt.yml
traversaro f305c97
Update apt.yml
traversaro 5a0f38c
check successful read of getSixAxisForceTorqueSensorMeasure
GiacomoBisio 2b18712
Test with getSixAxisForceTorqueSensorStatus
GiacomoBisio 1b97714
Delete README.md
GiacomoBisio 9f13744
Changes in tutorial sdf files
GiacomoBisio 234c357
Suppress tests on Windows
GiacomoBisio 0715cd4
Update conda-forge.yml
GiacomoBisio 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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -14,13 +14,13 @@ TEST(ForceTorqueTest, PluginTest) | |||||
// Instantiate test fixture | ||||||
gz::sim::TestFixture fixture("../../../tests/forcetorque/model.sdf"); | ||||||
|
||||||
int iterations = 5000; | ||||||
int iterations = 1000; | ||||||
fixture.Server()->Run(/*_blocking=*/true, iterations, /*_paused=*/false); | ||||||
|
||||||
yarp::os::Property option; | ||||||
option.put("device","multipleanalogsensorsclient"); | ||||||
option.put("remote","/forcetorque"); | ||||||
option.put("timeout",5.0); | ||||||
option.put("timeout",1.0); | ||||||
option.put("local", "/ForceTorqueTest"); | ||||||
yarp::dev::PolyDriver driver; | ||||||
|
||||||
|
@@ -36,7 +36,15 @@ TEST(ForceTorqueTest, PluginTest) | |||||
double timestamp; | ||||||
|
||||||
isixaxis->getSixAxisForceTorqueSensorName(0, sensorName); | ||||||
isixaxis->getSixAxisForceTorqueSensorMeasure(0, measure, timestamp); | ||||||
//isixaxis->getSixAxisForceTorqueSensorMeasure(0, measure, timestamp); | ||||||
size_t maxNrOfReadingAttempts = 20; | ||||||
bool readSuccessful = false; | ||||||
for (size_t i=0; (i < maxNrOfReadingAttempts) && !readSuccessful ; i++) | ||||||
{ | ||||||
readSuccessful = isixaxis->getSixAxisForceTorqueSensorMeasure(0, measure, timestamp); | ||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100)); | ||||||
} | ||||||
ASSERT_TRUE(readSuccessful); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please avoid mixing tabs and spaces, as it may result in inconsistent rendring (the width of tabs is not constant).
Suggested change
|
||||||
//std::cerr << "The measure of FT sensor " << sensorName << " is " << measure.toString() << " at time " << timestamp << std::endl; | ||||||
|
||||||
EXPECT_NEAR(measure(0), 0.0, 1e-2); | ||||||
|
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.
If we are not using it, let's remove it.