Repository navigation
feat(ros2): support legacy vehicle boxes and timestamp tolerance in recording readers - #21
Conversation
Max-Bin
left a comment
There was a problem hiding this comment.
Reviewed 23b276e against PR #16. This adds opt-in box expansion and sensor-frame conversion for recording readers, plus forward timestamp tolerance for previous and previous_per_group.
Please fix the previous selection issue before merging. I reproduced it by compiling the selector from this commit. Humble CI passed the installed C++ consumer and all 34 Python tests. CI results
| if (rule.method == Method::Previous && rule.tolerance_ns) { | ||
| auto end = std::upper_bound( | ||
| rows.begin(), rows.end(), | ||
| latest_tolerated_stamp(time, rule.tolerance_ns), |
There was a problem hiding this comment.
Keep an eligible observation when the newest stamp exceeds the age limit. With max_age_ns=1000, timestamp_tolerance_ns=2000, and visible observations at t and t + 1500 ns, this selects the second observation and then returns missing for row t. The exact sample at t is still within both limits. Cap the search tolerance at max_age_ns when it is set, as previous_per_group already does, and add this two-observation case to the installed test. Per-group implementation
There was a problem hiding this comment.
Fixed in 92758e4. previous and previous_per_group now both cap the forward search at min(timestamp_tolerance_ns, max_age_ns) when an age limit is set. In your example the sample at t + 1500 ns falls outside the search and the row keeps the sample at t. I added that exact two-observation case to the installed Python tests. The test now uses a profile dictionary so it also runs in CI’s isolated environment. All 35 generator tests passed locally on Humble and Jazzy. Regression test
| // ROS ObjectClassification label -> (total width added, front extension), in | ||
| // metres. | ||
| using BoxExpansion = std::map<uint8_t, std::pair<double, double>>; | ||
| Annotations convert_tracked_objects( |
There was a problem hiding this comment.
Please document the new C++ entry points in the generator's C++ guide. A short example can show SceneBuilder::from_yaml(), the BoxExpansion argument, and how to pass the row-major message-to-Scene transform to convert_tracked_objects(). C++ guide
There was a problem hiding this comment.
Added both examples to the C++ guide. The first builds a SceneBuilder from YAML text with per-class BoxExpansion values in metres. The second passes a row-major 4×4 message-to-Scene transform to convert_tracked_objects() and shows where the sensor translation goes. C++ examples
…ecording readers Signed-off-by: temkei.kem <temkei.kem@tier4.jp>
Signed-off-by: temkei.kem <temkei.kem@tier4.jp>
Signed-off-by: temkei.kem <temkei.kem@tier4.jp>
f2a38bc to
e9cea6e
Compare
Max-Bin
left a comment
There was a problem hiding this comment.
Re-reviewed e9cea6e. Both previous and previous_per_group now cap the forward search at the age limit. The regression test keeps the exact sample when the newer stamp exceeds that limit. The C++ guide now has examples for YAML profiles, box expansion, and sensor-frame conversion. Regression test · C++ examples
I built the rebased commit on Humble and ran the installed C++ consumer and all 35 Python generator tests. The 42 SDK window-decoding tests also passed.
For e2e-devkit #271, I reproduced the same edge case in the Python fallback. It still returns missing when a newer stamp exceeds the age limit and an exact sample is available. Please align that fallback when updating the T4Scene pin so both paths return the same observation. Devkit selector
Description
The DP2 H5 exporter and the Devkit rosbag reader both convert Autoware tracked objects into Scene annotations. Older Perception recordings contain vehicle boxes that exclude mirrors. Devkit can also receive objects in a sensor frame. This PR lets both readers use the ROS2 generator for the geometry while each reader chooses the settings for its recording. Downstream callers are in DiffusionPlanner2 #6 and e2e-devkit #271.
open_bag()orSceneBuilder. The Python legacy preset covers cars, trucks and buses. For a single message,convert_tracked_objects()returns an annotation batch and accepts the reader’s message-to-Scene transform. It applies the box correction before transforming and projecting into Scene XY. Python examplespreviousandprevious_per_grouprules can tolerate a small forward timestamp offset. The default is zero and decision-time cutoffs still apply. The loader checks topic names and reports missing topic/rule pairs. Sampling rulesThe shipped range example explicitly shows its three fixed settings. Custom profiles can omit them. The range still starts at its first odometry measurement and uses all observations for resampling. Range configuration
Validation
Annotationsbatch, and the installed builder loaded all three YAML examples in the configuration guide.