ros-navigation / navigation2_tutorials

Tutorial code referenced in https://docs.nav2.org/
184 stars 124 forks source link

Add waypoint plugin for taking photos at arrivals #12

Closed jediofgever closed 3 years ago

jediofgever commented 3 years ago

Hi ,

https://github.com/ros-planning/navigation2/commit/eff208ef5aa1b26356bda8f5fa8f304c7884327c was introduced to execute tasks at waypoint arrivals. We now want to add a tutorial to help people understand how to build their own plugins using provided interface.

For this purpose the tutorial plugin does following; subscribes to specified image topic takes photos at waypoint arrivals and saves taken photos to a specified directory with stamp.

An initial work has been committed https://github.com/jediofgever/navigation2_tutorials/commit/9b774af1339e93a45e1e6fb6e3839ceb0955c3a1

I would like to get an rough feedback on code and styling then I will be happy to submit a PR with requested modifications

SteveMacenski commented 3 years ago

This also overlaps the primary ticket: https://github.com/ros-planning/navigation.ros.org/issues/89

SteveMacenski commented 3 years ago

Rough review:

jediofgever commented 3 years ago

The name...

You have some cmake issues

tabs... remove all tabs....

The common.h stuff

C++ contains proper filepath tools

Use image transport subscriber to allow

So I will do modifications and submit a PR to navigation2 , does that mean the plugin wont be added to this repo ?

SteveMacenski commented 3 years ago

OK - on image_transport, it wouldn't take that long to make that all work. We have many examples of supporting different node types in Navigation2.

jediofgever commented 3 years ago

I suggest that we stick with the current state on that, to be able to make image_transport work with LifecycleNode will require modification image_transport API itself. I believe some time in future they will add that support. Also I haven't come across any package that use image_transport with a LifecycleNode at the moment

SteveMacenski commented 3 years ago

Images should always use image_transport, its really important. The efficiency gains of having access to compression is substantial. We can continue to a PR without it, but before merging, I'll want to have the image_transport stuff patched in.

jediofgever commented 3 years ago

I see , just an idea ,how about if we make this plugin to have double inheritance as such;

class WaypointPaparazzi : public nav2_core::WaypointTaskExecutor, public rclcpp::Node 
{
};

then I believe we will be able to use image_transport, but the parent LifecycleNode will be ghosted in that case ..

SteveMacenski commented 3 years ago

This will involve making image_transport lifecycle node compatible

SteveMacenski commented 3 years ago

We actually did this already :-)