-
Notifications
You must be signed in to change notification settings - Fork 786
[ros2] make transient local reliable #1033
[ros2] make transient local reliable #1033
Conversation
Signed-off-by: Karsten Knese <[email protected]>
|
Interesting that this hasn't come up before. Do you think you'd be able to add a test for spawning from a topic? If a test would be too much, maybe at least add an example to |
Signed-off-by: Karsten Knese <[email protected]>
|
@chapulina as mentioned offline, 00bf7ff fixes the actual compilation/tests for master. regarding the tests, I would propose to utilize launch_test to provide a node which publishes some xml model with the same QOS as the robot state publisher and run the entity spawner script after that and see if the scripts returns successfully. However, I don't have a clue about launch testing yet. So any help would be appreciated here. |
Signed-off-by: Karsten Knese <[email protected]>
|
b9a2ba2 adds a launch test which starts a mock robot state publisher, gzserver and finally checks if the spawn entity script exits correctly; meaning the entity is spawned correctly. @hidmic could you please have a look at the provided launch test? I've ran into quite some issues when changing @chapulina Can you please run CI on this? |
Signed-off-by: Karsten Knese <[email protected]>
|
It took a bit to figure out what's happening, but I believe I've understood now that the |
Signed-off-by: Karsten Knese <[email protected]>
Triggered here, hopefully I didn't mess it up: Also documented the CI triggering process here: https://github.com/ros-simulation/gazebo_ros_pkgs/wiki/ROS-2-CI |
|
@chapulina your CI branch has to be rebased on the latest master. Specifically you're missing this commit: ros2/ci#364 |
Signed-off-by: Karsten Knese <[email protected]>
Signed-off-by: Karsten Knese <[email protected]>
Signed-off-by: Karsten Knese <[email protected]>
3b48428 to
1fceb53
Compare
Signed-off-by: Karsten Knese <[email protected]>
1fceb53 to
d98dfe1
Compare
|
Exciting times. Build has passed. Test ran successfully: So this is now up for review and should definitely be backported to eloquent. |
chapulina
left a comment
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.
Thank you for the tests and for addressing all those other issues 💪
| ]) | ||
| ), | ||
| launch.actions.OpaqueFunction(function=lambda context: ready_fn()) | ||
| # launch_testing.actions.ReadyToTest() |
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.
Can the comment be removed?
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.
I am waiting on @hidmic to comment on this. ReadyToTest is apparently the preferred way of handling this, but it yields to problems on my machine. So I hope to get this solved.
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.
It is the preferred way indeed, and thus I'm curious why it doesn't work for you.
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.
The tests fails with output similar to this:
19: [INFO] [sh-1]: process started with pid [74368]
19: Timed out waiting for processes to start up
19: [INFO] [sh-1]: sending signal 'SIGINT' to process[sh-1]
19: [INFO] [gzserver-2]: process has finished cleanly [pid 73832]
19: Processes under test stopped before tests completed
19: -- run_test.py: return code 1
The test run correctly when using the old method.
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.
@Karsten1987 did you remove ready_fn from the arguments' list, as in examples/ready_action_test.py when you tried launch_testing.actions.ReadyToTest? On a probably unpleasant note, trying to use both old and new methods simultaneously may leave you in a state where neither works (see here).
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.
That seems to work. See 880cf8b
Is there a way to warn the user of this UB? Something like issuing a warning if ready_fn is available but the OpaqueFunction isn't used? I don't know the implications of this in the first place, just thinking out loud.
Co-Authored-By: chapulina <[email protected]>
Signed-off-by: Karsten Knese <[email protected]>
|
@chapulina fee09f6 should address your concerns about removing multiple instances. |
Signed-off-by: Karsten Knese <[email protected]>
chapulina
left a comment
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.
Thank you for all the extra fixes. It all looks good to me.
I tested the changes on gazebo_ros_force_system by using #1035 like this:
- Launch the demo world:
ros2 launch gazebo_ros gazebo.launch.py world:="src/gazebo_ros_pkgs/gazebo_ros/worlds/gazebo_ros_force_system_demo.world" - Insert a box from the top toolbar
- Apply 1st wrench:
ros2 service call /apply_link_wrench gazebo_msgs/srv/ApplyLinkWrench '{link_name: "unit_box::link", wrench: { force: { x: 10 } }, duration: {sec: -1, nanosec: 0} }' - Apply 2nd wrench:
ros2 service call /apply_link_wrench gazebo_msgs/srv/ApplyLinkWrench '{link_name: "unit_box::link", wrench: { force: { y: 10 } }, duration: {sec: -1, nanosec: 0} }' - Clear wrenches:
ros2 service call /clear_link_wrenches 'gazebo_msgs/srv/LinkRequest' '{link_name: "unit_box::link"}' - Reset world (
Ctrl+R) and check that the box doesn't move, because both wrenches have been correctly deleted.
(While testing this I noticed that the wrenches are not actually accumulating and only the last wrench is applied. I think we may want to use AddForce instead of SetForce but I can also see a use case for SetForce, so I won't touch the plugin for now.)
* make transient local reliable Signed-off-by: Karsten Knese <[email protected]> * fix master Signed-off-by: Karsten Knese <[email protected]> * add launch test Signed-off-by: Karsten Knese <[email protected]> * make it actual latched Signed-off-by: Karsten Knese <[email protected]> * alpha sort Signed-off-by: Karsten Knese <[email protected]> * add launch_test dependency Signed-off-by: Karsten Knese <[email protected]> * more dependencies Signed-off-by: Karsten Knese <[email protected]> * remove debug print Signed-off-by: Karsten Knese <[email protected]> * is_initialized -> ok Signed-off-by: Karsten Knese <[email protected]> * Update gazebo_ros/test/entity_spawner.test.py Co-Authored-By: chapulina <[email protected]> * use erase-remove idiom Signed-off-by: Karsten Knese <[email protected]> * use ReadyToTest() Signed-off-by: Karsten Knese <[email protected]> Co-authored-by: chapulina <[email protected]>
* [ros2] make transient local reliable (#1033) * make transient local reliable Signed-off-by: Karsten Knese <[email protected]> * fix master Signed-off-by: Karsten Knese <[email protected]> * add launch test Signed-off-by: Karsten Knese <[email protected]> * make it actual latched Signed-off-by: Karsten Knese <[email protected]> * alpha sort Signed-off-by: Karsten Knese <[email protected]> * add launch_test dependency Signed-off-by: Karsten Knese <[email protected]> * more dependencies Signed-off-by: Karsten Knese <[email protected]> * remove debug print Signed-off-by: Karsten Knese <[email protected]> * is_initialized -> ok Signed-off-by: Karsten Knese <[email protected]> * Update gazebo_ros/test/entity_spawner.test.py Co-Authored-By: chapulina <[email protected]> * use erase-remove idiom Signed-off-by: Karsten Knese <[email protected]> * use ReadyToTest() Signed-off-by: Karsten Knese <[email protected]> Co-authored-by: chapulina <[email protected]> * Set timeout and call gzserver directly Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: chapulina <[email protected]>
…os-simulation#1036) * [ros2] make transient local reliable (ros-simulation#1033) * make transient local reliable Signed-off-by: Karsten Knese <[email protected]> * fix master Signed-off-by: Karsten Knese <[email protected]> * add launch test Signed-off-by: Karsten Knese <[email protected]> * make it actual latched Signed-off-by: Karsten Knese <[email protected]> * alpha sort Signed-off-by: Karsten Knese <[email protected]> * add launch_test dependency Signed-off-by: Karsten Knese <[email protected]> * more dependencies Signed-off-by: Karsten Knese <[email protected]> * remove debug print Signed-off-by: Karsten Knese <[email protected]> * is_initialized -> ok Signed-off-by: Karsten Knese <[email protected]> * Update gazebo_ros/test/entity_spawner.test.py Co-Authored-By: chapulina <[email protected]> * use erase-remove idiom Signed-off-by: Karsten Knese <[email protected]> * use ReadyToTest() Signed-off-by: Karsten Knese <[email protected]> Co-authored-by: chapulina <[email protected]> * Set timeout and call gzserver directly Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: chapulina <[email protected]>
When using the robot state publisher topic (
robot_description) to spawn an entity into Gazebo, the topics don't match because the subscription reliability QoS don't match the publisher.I am wondering whether there is a mismatch between Python and C++ that by default a Python subscription is best effort whereas in C++ it's reliable.
Both, in Dashing as well as Eloquent, we weren't able to spawn objects correctly with the
spawn_entity.pyscript./cc @clalancette @relffok
Signed-off-by: Karsten Knese [email protected]