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

Question: port ros1 functionality to ros2 #27

Closed
reinzor opened this issue Jul 24, 2023 · 11 comments
Closed

Question: port ros1 functionality to ros2 #27

reinzor opened this issue Jul 24, 2023 · 11 comments

Comments

@reinzor
Copy link
Contributor

reinzor commented Jul 24, 2023

Hi,

We are in the process of migrating our ros1 system to ros2. We are currently using the ros1 driver that holds some additional diagnostics features compared to this ros2 driver. We would like to port these features to the ros2 repo, e.g.:

What would be the best way for us to address this? I also see that this repo contains quite some duplicated code:

Should we target both implementations or maybe do a refactor first?

What do you think?

Thanks!

@lenpuc
Copy link
Collaborator

lenpuc commented Jul 31, 2023

Hi,

if you are willing to do a refactor first, i would be happy to have a look at that PR.
And yes i know that are currently two implementations with a lot of similar code.

Afterwards, feel free to port your needed feature, I am happy to integrate them once again in the ROS2 version

@lenpuc
Copy link
Collaborator

lenpuc commented Jul 31, 2023

#26 this PR might be relevant for this

@reinzor
Copy link
Contributor Author

reinzor commented Jul 31, 2023

Great; we will look into it!

@reinzor
Copy link
Contributor Author

reinzor commented Aug 29, 2023

Due to holidays we did not have that much develop cycles this month. Just wanted to let you know that we will start working on this in the coming weeks.

@reinzor
Copy link
Contributor Author

reinzor commented Aug 31, 2023

Hi @puck-fzi ; when thinking about this a bit more. We think it would be an easier process to create ros2 branch in the https://github.com/SICKAG/sick_safetyscanners repository and do the ros2 migration based on the current main branch. Of course we could additionally implement the lifecycle node afterwards. What do you think?

This way the two repositories would be more aligned.

@lenpuc
Copy link
Collaborator

lenpuc commented Aug 31, 2023

Dear Reinzor, long term, it is planned to have the node separation of the CPP core lib and the driver on top of it. So, I would instead integrate the functionality into this lib here rather than in the ROS1 lib as a separate branch. Long-term all features of the ROS1 node should be included in the ROS2 driver.

The CPP Lib already contains additional features, which are not in the ROS1 driver included anymore.

@reinzor
Copy link
Contributor Author

reinzor commented Aug 31, 2023

OK, clear. Then we will take this repository as a base and start with a refactor that eliminates the duplicated code. After that, we can start porting ROS1 features to ROS2.

@reinzor
Copy link
Contributor Author

reinzor commented Sep 1, 2023

Hi @puck-fzi ; I am somewhat stuck in the refactor of combining the lifecycle and normal node since rclcpp::Node and rclcpp_lifecycle::LifecycleNode have different implementations. Also see ros2/rclcpp#898

The problem is that I cannot properly combine two implementations when I am going to add diagnostics, declare parameters, diagnostics etc. We would like to add a diagnostic updater and a diagnosed publisher.

What do you think what is the best plan here? We internally have no need for the lifecycle nodes and adding the ros1 features to the normal node would be sufficient. However, this results in both node implemenations going out of sync. Any ideas, suggestions appreciated.

@reinzor
Copy link
Contributor Author

reinzor commented Sep 5, 2023

@puck-fzi any thoughts?

@lenpuc
Copy link
Collaborator

lenpuc commented Sep 5, 2023

Just off the top of my head, it might be worth refactoring the functionality into a separate helper class, which is then used by both the lifecycle and the normal nodes. Therefore, the code duplication is reduced.

Then maybe both nodes can have their separate interface and just use the same helper classes, then you could add to the normal node your desired diagnostics. Then the code would not be that out of sync and just slightly different functionality in each node.
I think there are cases where either node might be beneficial.

@lenpuc
Copy link
Collaborator

lenpuc commented Nov 27, 2023

PR #33 merged

@lenpuc lenpuc closed this as completed Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants