-
Notifications
You must be signed in to change notification settings - Fork 77
feat(velodyne): enable dynamic reconfigure of launch_hw parameter #263
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mukunda Bharatheesha <mukunda.bharatheesha@nobleo.nl>
Signed-off-by: Mukunda Bharatheesha <mukunda.bharatheesha@nobleo.nl>
|
@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 <mukunda.bharatheesha@nobleo.nl>
|
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. |
|
@mbharatheesha |
|
@knzo25 @mojomex Sorry for my silence on this. I got occupied with other issues and then had some holidays. I just returned and tested the proposed changes in this PR with the latest
That said, I also noticed some recent comments from @mojomex here. This idea seems more promising/flexible than the ones proposed in this PR. So, I am getting more inclined towards Lifecycle implementation to have this sorted out cleanly. I would appreciate some feedback/thoughts about this before proceeding. Because, it seems like a larger group discussion is required before taking up changes like Lifecycle node implementations. Please correct me if I am wrong. |
|
@mojomex How would you like to proceed ? 🙏 |
|
@mojomex @knzo25 @drwnz I took a leap of faith that lifecycle nodes would be considered going forward and implemented the same in this branch Good news is I could do initial tests using a VLP 16 with hardware and no hardware and in both cases, the transitions work as expected. I can do multiple lifecycle transitions, i.e., When connected to hardware, pointclouds only get published when the lifecycle node is in I don't have access to other sensor types though. I may need some help with testing those. Also, it would be great if you could share some thoughts on the direction I have taken. Particularly:
Once I hear back, I will update the tests accordingly and open a PR and close this one. |
|
@mojomex @drwnz @knzo25 Over the last couple of weeks, I did some testing with the lifecycle implementations from the branch mentioned above, by integrating it with our use case. I thought of sharing some insights I gathered that are generally applicable to Lifecycle nodes:
I am not against using Lifecycle implementations based on these insights, but it just turned out to be more trouble to use in our usecase. I think it may still be relevant for usecases that this code base mainly targets at. So, I will still be happy to add lifecycle contributions into this repo. However, I am feeling more inclined towards having both supported. Since most of the "business logic" for the driver is split into separate packages here anyway, it may be a matter of creating But I guess the decision is up to you guys and I can adapt my contribution accordingly. |



PR Type
Description
This PR introduces changes to allow for dynamically reconfiguring the
launch_hwparameter for the velodyne driver so that the driver can be started at run time instead of always at startupReview Procedure
launch_hwparameter reconfigurable is desired.I tested these changes by running the driver with an actual VLP16 connected by doing the following tests:
launch_hwset tofalse. Then change the parameter totrue. The driver successfully starts communicating with connected hardware and publishes pointcloudslaunch_hwset totrue. The driver publishes pointclouds as expected. Then change the parameter tofalse. The driver stops publishing pointclouds.trueand it is set totrueagain, nothing happens. Same if the parameter wasfalseand set tofalseagain.Remarks
jthreadsupport is integrated into stl. Andjthreadsimplifies the stopping and starting of threads whenlaunch_hwis changed at run time. The behavior in this PR could also be achieved withstd::threadand C++ 17, but I just felt the possibility to userequest_stopand thestop_tokenfeatures 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