Skip to content
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 frame_id and child_frame_id attribute support for DiffDrive #361

Merged

Conversation

doisyg
Copy link
Contributor

@doisyg doisyg commented Sep 20, 2020

Add configuration of the odom frame_id and child_frame_id fields from sdf attributes <frame_id> and <child_frame_id>
Example:

    <plugin
      filename="libignition-gazebo-diff-drive-system.so"
      name="ignition::gazebo::systems::DiffDrive">
      <left_joint>left_wheel_joint</left_joint>
      <right_joint>right_wheel_joint</right_joint>
      <wheel_separation>${base_y_origin_to_wheel_origin*2}</wheel_separation>
      <wheel_radius>${wheel_radius}</wheel_radius>
      <odom_publish_frequency>20</odom_publish_frequency>
      <topic>cmd_vel</topic>
      <odom_topic>odom</odom_topic>
      <frame_id>odom</frame_id>
      <child_frame_id>base_footprint</child_frame_id>
    </plugin>

Partialy solves #340

@doisyg doisyg force-pushed the ign-gazebo-3_diffdrive_frameids branch from d412851 to 472ec3f Compare September 20, 2020 21:30
@chapulina chapulina added the 🏰 citadel Ignition Citadel label Sep 23, 2020
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! The changes all look good to me. I left a couple nitpick comments. One last think I would ask is if you could add a test checking if both the old and new behaviors work as expected. The best place to add it would be in test/integration/diff_drive_system.cc

src/systems/diff_drive/DiffDrive.cc Outdated Show resolved Hide resolved
src/systems/diff_drive/DiffDrive.cc Outdated Show resolved Hide resolved
@doisyg
Copy link
Contributor Author

doisyg commented Oct 6, 2020

One last think I would ask is if you could add a test checking if both the old and new behaviors work as expected. The best place to add it would be in test/integration/diff_drive_system.cc

Can you point me to a documentation on how to write/use these tests ?

@chapulina
Copy link
Contributor

Can you point me to a documentation on how to write/use these tests ?

It's on the README:

https:/ignitionrobotics/ign-gazebo#testing

If you're using colcon, you can run colcon test.

Our high-level contribution docs also have more info:

https://ignitionrobotics.org/docs/all/contributing#writing-tests

@doisyg
Copy link
Contributor Author

doisyg commented Nov 24, 2020

Synced and added 2 tests for old and new behaviors.
Sorry about the delay

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the tests. I have left some fairly minor comments that I think would simplify the tests. I would also ask if you could fix some code style issues according to our style guide. You can find the errors in the github build, but you can also check locally by running make codecheck.

Otherwise, this looks pretty good.

test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
test/integration/diff_drive_system.cc Outdated Show resolved Hide resolved
@doisyg
Copy link
Contributor Author

doisyg commented Dec 3, 2020

Hopefully more simple tests and better style

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one more style nit. Also, could you signing off on your commits? Here are the instructions:
https:/ignitionrobotics/ign-gazebo/pull/361/checks?check_run_id=1494209342

src/systems/diff_drive/DiffDrive.cc Outdated Show resolved Hide resolved
@azeey
Copy link
Contributor

azeey commented Dec 10, 2020

The test failures are not caused by this PR, so I'm ready to merge. I think the only thing left is the DCO.

@doisyg doisyg force-pushed the ign-gazebo-3_diffdrive_frameids branch 6 times, most recently from f052667 to cf6f5b9 Compare December 13, 2020 16:35
@azeey
Copy link
Contributor

azeey commented Dec 14, 2020

I think there was a bad merge/rebase. This now shows conflicts in files not touched by this PR. Do you mind rebasing on to ign-gazebo3 without including commits outside of this PR? If you have the https:/ignitionrobotics/ign-gazebo/ as upstream, you can do:

# With the PR branch checked out
git fetch upstream

git rebase -i --signoff upstream/ign-gazebo3
# drop commit d353f66b
git push --force-with-lease

Guillaume added 4 commits December 14, 2020 20:55
Signed-off-by: Guillaume Doisy <[email protected]>
wip
Signed-off-by: Guillaume Doisy <[email protected]>
Guillaume added 5 commits December 14, 2020 20:55
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
@doisyg doisyg force-pushed the ign-gazebo-3_diffdrive_frameids branch from cf6f5b9 to 6ead525 Compare December 14, 2020 19:56
@doisyg
Copy link
Contributor Author

doisyg commented Dec 14, 2020

Done, sorry about the mess caused by the signofff/rebase

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting the DCO issue resolved. I have a couple more requests that should help with the failing tests.

test/integration/diff_drive_system.cc Show resolved Hide resolved
test/integration/diff_drive_system.cc Show resolved Hide resolved
Signed-off-by: Guillaume Doisy <[email protected]>
@doisyg doisyg force-pushed the ign-gazebo-3_diffdrive_frameids branch from c9e2141 to 6a1d72e Compare December 15, 2020 22:04
@azeey
Copy link
Contributor

azeey commented Dec 19, 2020

Looks like there are still some failures. I think merging from ign-gazebo3 would fix them though. If you don't mind giving me write permission to the PR, I can do it for you.

@doisyg
Copy link
Contributor Author

doisyg commented Dec 19, 2020

Looks like there are still some failures. I think merging from ign-gazebo3 would fix them though. If you don't mind giving me write permission to the PR, I can do it for you.

For some reason, I could not find the option to give you a write permission. Indeed the codecheck failure are not related to this PR. I merged ign-gazebo3 into this PR branch

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The remaining test failures appear to be flaky or unrelated to this PR. Thanks for your patience.

@azeey azeey merged commit 7643e7b into gazebosim:ign-gazebo3 Dec 19, 2020
j-rivero pushed a commit that referenced this pull request Jan 4, 2021
Add configuration of the odom frame_id and child_frame_id fields from sdf attributes <frame_id> and <child_frame_id>

Signed-off-by: Guillaume <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
mjcarroll added a commit that referenced this pull request Jan 8, 2021
* Clarify how sim time is interpreted in a System's step (#467)
* add frame_id and child_frame_id attribute support for DiffDrive (#361)
* Add ability to record video based on sim time (#414)
* add ability to record video from gui camera using sim time
* add msg
* use QueryBoolText
* Add lockstep mode to video recording (#419)
* Disable right click menu when using measuring tool (#458)
* Bump to 3.6.0 (#524)
* Don't make docs on macOS (#528)
* Updates to ardupilot migration tutorial (#525)
* Update gtest to 1.10.0 for Windows compilation (ign-gazebo3) (#506)
* Compile new gtest with c++11
* Use INSTANTIATE_TEST_SUITE_P instead of deprecated -INSTANTIATE_TEST_CASE_P
* Apply suggestions from code review
* One more tutorial version bump
* Fix bad merge
* change nullptr to a int ptr for qt 5.15.2 bug (#527)
* Generate valid topics everywhere (support names with spaces) (#522)
* Change deprecated test case->suite

Co-authored-by: Ashton Larkin <[email protected]>
Co-authored-by: G.Doisy <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Co-authored-by: John Shepherd <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Akash Patel <[email protected]>
Lobotuerk added a commit to Lobotuerk/ign-gazebo that referenced this pull request Jan 11, 2021
* Initial commit

Signed-off-by: Martiño Crespo <[email protected]>

* Added plugin files

Signed-off-by: Martiño Crespo <[email protected]>

* Initial .sdf file

Signed-off-by: Martiño Crespo <[email protected]>

* Pipeline for getting sensor contacts

Signed-off-by: Martiño Crespo <[email protected]>

* Added visualization of postion and forces

Signed-off-by: Martiño Crespo <[email protected]>

* Added plugin for Transform Control

Signed-off-by: Martiño Crespo <[email protected]>

* Added initial interpolation

Signed-off-by: Martiño Crespo <[email protected]>

* Code check

Signed-off-by: Martiño Crespo <[email protected]>

* Update info after specified milliseconds

Signed-off-by: Martiño Crespo <[email protected]>

* Set marker lifetime for better performance

Signed-off-by: Martiño Crespo <[email protected]>

* Added Depth Camera

Signed-off-by: Martiño Crespo <[email protected]>

* Added callback and unpacking to Depth Camera messages

Signed-off-by: Martiño Crespo <[email protected]>

* Compute and visualize normal forces

Signed-off-by: Martiño Crespo <[email protected]>

* PR Feedback 1

Signed-off-by: Martiño Crespo <[email protected]>

* Update sdf example to a more realistic environment

Signed-off-by: Martiño Crespo <[email protected]>

* Allow moving Depth Camera from model origin

Signed-off-by: Martiño Crespo <[email protected]>

* Make markers dimensions available as parameters

Signed-off-by: Martiño Crespo <[email protected]>

* Visualize sensor as a marker instead of <visual> and filter out normal forces outside sensor

Signed-off-by: Martiño Crespo <[email protected]>

* PR Feedback 2

Signed-off-by: Martiño Crespo <[email protected]>

* PR Feedback 3

Signed-off-by: Martiño Crespo <[email protected]>

* Minor fixes for sdf, sensor marker and profiler

Signed-off-by: Martiño Crespo <[email protected]>

* PR Feedback 4

Signed-off-by: Martiño Crespo <[email protected]>

* fix mac warning

Signed-off-by: Mabel Zhang <[email protected]>

* Helper function to set component data (gazebosim#436)

Signed-off-by: Louise Poubel <[email protected]>

* Remove unneeded if statement (gazebosim#432)

Signed-off-by: John Shepherd <[email protected]>

* Fixes flaky RecordAndPlayback test in INTEGRATION_log_system (gazebosim#463)

The flakiness comes from two sources:
1. Poses recorded by the LogRecorder are published by the
   SceneBroadcaster system throttled at 60 Hz. The throttle mechanism
   uses real-time instead of sim-time which causes a variance in the
   number of recorded poses from run to run. However, the expected number of
   recorded poses was calculated with the assumption that the simulation
   would run with a 1.0 RTF. If the CPU load is high, there could be a
   mismatch between the expected and the actual number of recorded
   poses, which causes the test to fail.
   This can be checked by running the test with
`cpulimit -l 20 -f  bin/INTEGRATION_log_system  -- --gtest_filter="*RecordAndPlayback"`

2. An attempt is made to match up played back poses with the closest
   timestamp in the recorded file. These poses are again published by
   the SceneBroadcaster, so they are subject to the same kind of timing
   issues as the recorded poses.

The solution in this patch for the first issue is to determine the
expected number of recorded poses by counting them in a separate system
that mimics the throttling mechanism of ign-transport. For the second
issue, a testing system is added to the playback server bypassing the
SceSceneBroadcaster altogether.

Signed-off-by: Addisu Z. Taddese <[email protected]>

* Make PeerTracker test more robust (gazebosim#452)

Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Michael Carroll <[email protected]>

* Clarify how sim time is interpreted in a System's step (gazebosim#467)

Signed-off-by: Ashton Larkin <[email protected]>

* 3 ➡️  4: fixes for gazebosim#463 (gazebosim#469)

Signed-off-by: Louise Poubel <[email protected]>

* Link link tutrial (gazebosim#472)

Signed-off-by: Louise Poubel <[email protected]>

* Switch to async state service request (gazebosim#461)

Signed-off-by: Ian Chen <[email protected]>

* Use a std::promise/std::future to avoid busy waiting the step ack messages in NetworkManagerPrimary (gazebosim#470)

Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>

* Fix tests that use Fuel paths with uppercase letters (gazebosim#480)

As of gazebosim/gz-fuel-tools#130, fuel paths use all lowercase letters. This fixes some tests that had uppercase letters.
Signed-off-by: Addisu Z. Taddese <[email protected]>

* 4.1.0 (gazebosim#485)

Signed-off-by: Ashton Larkin <[email protected]>

* Update key event handling (gazebosim#466)

Signed-off-by: John Shepherd <[email protected]>

* Fix slot in Plotting plugin (gazebosim#490)

Signed-off-by: Alejandro Hernández <[email protected]>

* Tape Measure Plugin (gazebosim#456)

Signed-off-by: John Shepherd <[email protected]>

* Satisfy make codecheck (gazebosim#491)

Signed-off-by: Louise Poubel <[email protected]>

* Move deselect and preview termination to render thread (gazebosim#493)

Signed-off-by: John Shepherd <[email protected]>

* Fix codecheck (gazebosim#499)

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>

* Logical Audio Sensor Plugin (gazebosim#401)

Signed-off-by: Ashton Larkin <[email protected]>

* Codecheck - initialize primitive in LogicalAudio component (gazebosim#502)

Signed-off-by: Ashton Larkin <[email protected]>

* 3 to 4: fix codecheck for ign-gazebo4

Signed-off-by: Ashton Larkin <[email protected]>

* 3 to 4: resolve codecheck warnings

Signed-off-by: Ashton Larkin <[email protected]>

* add frame_id and child_frame_id attribute support for DiffDrive (gazebosim#361)

Add configuration of the odom frame_id and child_frame_id fields from sdf attributes <frame_id> and <child_frame_id>

Signed-off-by: Guillaume <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>

* Require ign-gui 4.1.0 (gazebosim#505)

Signed-off-by: Louise Poubel <[email protected]>

* Fix shadow artifacts by disabling double sided rendering (gazebosim#446)

* read double sided sdf param

Signed-off-by: Ian Chen <[email protected]>

* update migration

Signed-off-by: Ian Chen <[email protected]>

* Make the tunnels example world more interesting (gazebosim#462)

Signed-off-by: Louise Poubel <[email protected]>

* add double sided msg to sdf conversion

Signed-off-by: Ian Chen <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>

* Add ability to record video based on sim time (gazebosim#414)

* add ability to record video from gui camera using sim time

Signed-off-by: Ian Chen <[email protected]>

* add msg

Signed-off-by: Ian Chen <[email protected]>

* use QueryBoolText

Signed-off-by: Ian Chen <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>

* Add lockstep mode to video recording (gazebosim#419)

Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>

* Kinetic energy monitor plugin (gazebosim#492)

Signed-off-by: Gonzalo de Pedro <[email protected]>
Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>

* Disable right click menu when using measuring tool (gazebosim#458)

Signed-off-by: John Shepherd <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>

* Bump to 3.6.0 (gazebosim#524)

Signed-off-by: Louise Poubel <[email protected]>

* Don't make docs on macOS (gazebosim#528)

add comment about doxygen bug

Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Steve Peters <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>

* Updates to ardupilot migration tutorial (gazebosim#525)

Signed-off-by: Louise Poubel <[email protected]>

* Update gtest to 1.10.0 for Windows compilation (ign-gazebo3) (gazebosim#506)

* Compile new gtest with c++11
* Use INSTANTIATE_TEST_SUITE_P instead of deprecated -INSTANTIATE_TEST_CASE_P

Signed-off-by: Jose Luis Rivero <[email protected]>

* Apply suggestions from code review

Signed-off-by: Michael Carroll <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>

* change nullptr to a int ptr for qt 5.15.2 bug (gazebosim#527)

See: https://bugreports.qt.io/browse/QTBUG-89114
Signed-off-by: acxz <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

* Generate valid topics everywhere (support names with spaces) (gazebosim#522)

Signed-off-by: Louise Poubel <[email protected]>

* One more tutorial version bump

Signed-off-by: Michael Carroll <[email protected]>

* Fix bad merge

Signed-off-by: Michael Carroll <[email protected]>

* change nullptr to a int ptr for qt 5.15.2 bug (gazebosim#527)

See: https://bugreports.qt.io/browse/QTBUG-89114
Signed-off-by: acxz <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

* Generate valid topics everywhere (support names with spaces) (gazebosim#522)

Signed-off-by: Louise Poubel <[email protected]>

* Change deprecated test case->suite

Signed-off-by: Michael Carroll <[email protected]>

* 3 ➡️ 4 (gazebosim#533)

* Clarify how sim time is interpreted in a System's step (gazebosim#467)
* add frame_id and child_frame_id attribute support for DiffDrive (gazebosim#361)
* Add ability to record video based on sim time (gazebosim#414)
* add ability to record video from gui camera using sim time
* add msg
* use QueryBoolText
* Add lockstep mode to video recording (gazebosim#419)
* Disable right click menu when using measuring tool (gazebosim#458)
* Bump to 3.6.0 (gazebosim#524)
* Don't make docs on macOS (gazebosim#528)
* Updates to ardupilot migration tutorial (gazebosim#525)
* Update gtest to 1.10.0 for Windows compilation (ign-gazebo3) (gazebosim#506)
* Compile new gtest with c++11
* Use INSTANTIATE_TEST_SUITE_P instead of deprecated -INSTANTIATE_TEST_CASE_P
* Apply suggestions from code review
* One more tutorial version bump
* Fix bad merge
* change nullptr to a int ptr for qt 5.15.2 bug (gazebosim#527)
* Generate valid topics everywhere (support names with spaces) (gazebosim#522)
* Change deprecated test case->suite

Co-authored-by: Ashton Larkin <[email protected]>
Co-authored-by: G.Doisy <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Co-authored-by: John Shepherd <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Akash Patel <[email protected]>

* Add support for topic statistics on breadcrumb deployments (gazebosim#532)

* Add support for topic statistics on breadcrumb deployments

Signed-off-by: Nate Koenig <[email protected]>

* Require version 9.1 of ignition transport

Signed-off-by: Nate Koenig <[email protected]>

* Move to after mutex

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Carlos Agüero <[email protected]>

Co-authored-by: Martiño Crespo <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Co-authored-by: Mabel Zhang <[email protected]>
Co-authored-by: John Shepherd <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
Co-authored-by: Ashton Larkin <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
Co-authored-by: Ivan Santiago Paunovic <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: Nate Koenig <[email protected]>
Co-authored-by: G.Doisy <[email protected]>
Co-authored-by: Gonzo <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Akash Patel <[email protected]>
Co-authored-by: Carlos Agüero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants