-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Depth and IMU data processing #43
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
Expanded README to include detailed sensor data processing information, including IMU, depth sensor, and DVL processing. Added sections for usage, nodes, published and subscribed topics, installation instructions, and dependencies.
created imuprocessing.h file. Takes acceleration readings from imu sensor and derives acceleration in the pool frame of reference. Requires nadim to add helper function to create rotation matrix from quarternion input from imu.
Updated README.md to provide details about the sensor_node, including inputs, outputs, published and subscribed topics, dependencies, building, and running instructions.
…_node run regardless of sim.
Updated the README to clarify the launch command for sensors.
JPGC04
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.
Very nice progress in this pr. All this needs to be tested in real life to make sure data is actually being published in real life.
| @@ -0,0 +1,27 @@ | |||
| #pragma once | |||
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.
While this probably works and is supported, it is not the proper way to handle library files. Please use #ifndef for these instead for all you .hpp file.
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’d recommend to add a deconstructor (Albert drilled that into me), essentially it’s a clean up of memory usage that isn’t automatically cleaned when ctrl-c. As far as this node is concerned, it should be a one liner since I don’t think there’s memory usage not handled by the OS already. However, as good practice plus being consistent with the future in case one day it is useful I’d say to add it (ironic all the yap for one line command).
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.
Also, I know it probably won’t affect things much but has possible performance impacts been considered for putting all the sensors handled by one node instead of split up ones? Again probably not much impact ahead but a thing to think about in case timing of subscribers and others stuff is off
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.
To answer the first comment, a default deconstructor is added in Sensor_Node.hpp on line 23. Not sure if I am properly adressing your comment. Let me know if I got something wrong.
For the second comment, the fact they are all member variable of one parent object makes information sharing between the processors easier. The depth processor can access the vehcile's orientation directly from the IMU processor (see line 60 in Sensor_Node.cpp). Otherwise, information would have to be sent over a topic. Making that parent object a Node instead of both processors being Nodes seemed cleaner to me. Like this, the processors are ROS-independant.
Let me know if there is anything else.
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.
My bad I did not see that. I think it should be good.
While I get that idea of sharing information and convenience, I still worry about potential issues that can be brought up. Firstly, unless coded for, each ROS2 node seem to operate as a single thread and use only 1 core of the CPU. This can lead to having one sensor waiting on another sensor messing with the accuracy of the state when you end up doing ekf or sensor aggregation. More specifically, while the slower sensor processes its callback, the faster one's data cannot be read and starts building up in a queue. If the queue has no limit, this can lead to running out of memory causing a crash. If the queue has a limit, at one point, sensor data gets erased. Communicating over a topic, from what I can find online, takes about 1-10ms, which is like 1 IMU reading loss if it runs at 100Hz, so it should not be too bad. Up to you since you're the state estimation specialist to determine how bad this may be. Brief research into this (this kinda looks like a rabbit hole) shows that even explicitely writing a multithreadexecutor for ROS2 does not always solve the node being bottlenecked into a single core.
Secondly, from a failure point, if the depth sensor section of the node crashes it will take down the rest of the sensors with it. Since we made a big point on modularity of our code, I think we should stay consistent on that end. I also think that for beginners reading our code, having each sensor being its own node and thus its own file makes things more "digestible" for a new member.
Thirdly, I do not know how memory is managed for each node as a process. However, as a general rule of thumb, try not too bundle up too much into one node. If ROS2 actually operates like a proper operating system, it decides how much memory is given for each node, which if your node is too big it may overflow (unlikely but good to know). This node written does not seem that heavy but I think its cool and useful to know.
Finally, I also want to say I am no expert in all of this. Having just gotten an internship dealing with OS shenanigans, I am being introduced to all these OS tasks sharing and memory allocations so I think raising these questions to be pondered is valid. There are also other possible issues concerning data sharing, which I don't feel qualified enough to talk about. All that talk to say that I think doing it in one node introduces many error points that can be simply solved by writing different nodes.
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.
Thanks for the throrough comment, what you are saying makes esnse.
I'll try to split it up the processors when I find some free time.
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.
Refactored the package and split up the nodes
WilliamZhang2205
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.
Minor stuff in comments I left. Great BOOMIN work overall. I agree with what the big boss JP man say, what he said
…ith the new nodes. JP approved commit message uwu
Co-authored-by: Stuart-Klenner <[email protected]> Co-authored-by: hutchallison <[email protected]> Co-authored-by: Vincenzo Bigattini <[email protected]> Co-authored-by: anna joy <[email protected]> Co-authored-by: John-Paul Chouery <[email protected]>
Updated the DVL processing section to clarify the transformation matrix notation and added a link to relevant documentation.
…UV-2026 into dev/llmweapons
This PR restructures the sensors package and adds processing for incoming IMU and depth data.
Added
ImuRepublisherandDepthRepublisherprocessors and integrated them into a singlesensor_nodeexecutable for easier state sharing (e.g., using the latest IMU orientation when processing depth).Updated CMakeLists.txt to build/install sensor_node and removed obsolete executables/sources from the package.
Updated launch to start the Xsens driver only when sim:=false,
sensor_noderuns regardless of sim.Updated package.xml to include Eigen dependencies and refreshed README.md with detailed IMU/depth processing documentation.
TODO: