-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat(velodyne): enable dynamic reconfigure of launch_hw parameter #263
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mukunda Bharatheesha <[email protected]>
Signed-off-by: Mukunda Bharatheesha <[email protected]>
@mojomex I was working on this feature for our application that required us to enable or disable lidar hardware at runtime. I thought this might also be interesting to other users and hence thought of creating this PR. If this is a desired feature, I can also work on similar features for the supported lidar types. |
Signed-off-by: Mukunda Bharatheesha <[email protected]>
Hi @mbharatheesha, thanks for the PR! We've indeed been thinking about this but haven't gotten around to it yet. While I share your enthusiasm for C++20, there are still some Nebula users (e.g. users of some ECUs) whose compilers don't support C++20. So at the moment, as much as I'd want to move to C++20, we'll have to wait for another bit of time. Otherwise, super nice PR! Please let me know if you would be up for making those changes or if that is too much work at the moment. |
@mojomex Thanks for your feedback.
I understand. Initially that was something I thought too looking at the recent implementations in Ouster drivers with LifecycleNodes. But, I thought it would make the delta really big and indeed, I wasn't aware of the direction you guys were thinking about. So, I decided against it.
Sure, I can revert the implementation to C++17 and use
As of the next three weeks, I don't have time to look into the lifecycle implementation approach. After that, I can take a look at this again. In the meanwhile, if you guys think this can be a stand-in, let me know. Otherwise, I am fine to close this PR and re-open a new one later when I get a chance to work on LifeCycle Node approaches. |
@drwnz What do you think? |
@mbharatheesha @mojomex thanks for proposing this! |
@drwnz Alright. I will make that change over the weekend. Also, I think similar PRs for hesai and robosense would be nice. I will also make separate PRs for them to keep focused deltas per supported lidar type. |
PR Type
Description
This PR introduces changes to allow for dynamically reconfiguring the
launch_hw
parameter for the velodyne driver so that the driver can be started at run time instead of always at startupReview Procedure
launch_hw
parameter reconfigurable is desired.I tested these changes by running the driver with an actual VLP16 connected by doing the following tests:
launch_hw
set tofalse
. Then change the parameter totrue
. The driver successfully starts communicating with connected hardware and publishes pointcloudslaunch_hw
set totrue
. The driver publishes pointclouds as expected. Then change the parameter tofalse
. The driver stops publishing pointclouds.true
and it is set totrue
again, nothing happens. Same if the parameter wasfalse
and set tofalse
again.Remarks
jthread
support is integrated into stl. Andjthread
simplifies the stopping and starting of threads whenlaunch_hw
is changed at run time. The behavior in this PR could also be achieved withstd::thread
and C++ 17, but I just felt the possibility to userequest_stop
and thestop_token
features made for better readability.While the desired dynamic reconfiguration works without any errors, there is one unexplained behavior that I would like some feedback on:
packet_queue_.pop()
and doesn't allow the thread to finish. For example, if I try to do adecoder_thread_.join()
in theclean_up_on_reconfigure()
function before deleting the hw interface and hw monitor objects, the call toclean_up_on_reconfigure()
never finishes.Pre-Review Checklist for the PR Author
Checklist for the PR Reviewer
Reviewers should check the checkboxes below before approval.
Post-Review Checklist for the PR Author
PR Author should check the checkboxes below before merging.
CI Checks