RecordSurfaceCoverage Class
Paint the part of a target surface a tool just treated, and add it to the coverage recorded so far. More...
Declaration
Included Headers
Base class
| class | AsyncBehaviorBase |
|
A base class for behaviors which need to asynchronously run a function that might take a long time to complete. More... | |
Public Constructors Index
| RecordSurfaceCoverage (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
Private Member Functions Index
| tl::expected< bool, std::string > | doWork () override |
|
Reads the ports, brings the tool path into the target cloud's frame, selects and paints the covered points, and merges them with the coverage recorded so far. More... | |
| std::shared_future< tl::expected< bool, std::string > > & | getFuture () override |
|
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member. More... | |
Private Member Attributes Index
| std::shared_future< tl::expected< bool, std::string > > | future_ |
|
Classes derived from AsyncBehaviorBase must have this shared_future as a class member. More... | |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
Description
Paint the part of a target surface a tool just treated, and add it to the coverage recorded so far.
Takes the tool poses that were executed (for example the coverage_path a Cartesian plan followed) and the point cloud representing the target, marks every target point the tool's footprint reached, and returns those points in a single solid color. Feeding the previous result back in through previous_coverage accumulates a treatment history across sweeps; publishing that history with SendPointCloudToUI paints it over the target in the 3D view.
The footprint is a cylinder of footprint_radius about the tool +Z axis reaching out to footprint_range, which matches the tool frame GenerateSurfaceCoveragePath emits: +Z points into the surface, so footprint_range must exceed the standoff the sweep was planned with.
The result is expressed in output_frame_id — a frame that holds still relative to the target, so the history stays aligned as the robot and its cameras move. Both the tool path and the target cloud are placed using the transform at the cloud's timestamp, so a cloud whose frame moves must be recorded before it ages out of the transform buffer; use_latest_transform is the escape hatch when the cloud's frame is in fact static. Both the newly covered points and previous_coverage are merged onto a voxel grid of merge_voxel_size, which is what keeps a long treatment history from growing without bound as sweeps overlap. The merge averages the points that share a voxel, colors included, so sweeps recorded with different treated_color values blend where they overlap.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| target_cloud | input | sensor_msgs::msg::PointCloud2 |
| tool_path | input | std::vector<geometry_msgs::msg::PoseStamped> |
| footprint_radius | input | double |
| footprint_range | input | double |
| treated_color | input | std::vector<int> |
| output_frame_id | input | std::string |
| merge_voxel_size | input | double |
| use_latest_transform | input | bool |
| previous_coverage | input | sensor_msgs::msg::PointCloud2 |
| coverage_cloud | output | sensor_msgs::msg::PointCloud2 |
Definition at line 54 of file record_surface_coverage.hpp.
Public Constructors
RecordSurfaceCoverage()
|
Declaration at line 57 of file record_surface_coverage.hpp, definition at line 196 of file record_surface_coverage.cpp.
Private Member Functions
doWork()
| virtual |
Reads the ports, brings the tool path into the target cloud's frame, selects and paints the covered points, and merges them with the coverage recorded so far.
- Returns
True once the output port holds the accumulated coverage, or an error message.
Declaration at line 70 of file record_surface_coverage.hpp, definition at line 252 of file record_surface_coverage.cpp.
getFuture()
| inline virtual |
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
Definition at line 73 of file record_surface_coverage.hpp.
Private Member Attributes
future_
|
Classes derived from AsyncBehaviorBase must have this shared_future as a class member.
Definition at line 79 of file record_surface_coverage.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 62 of file record_surface_coverage.hpp, definition at line 246 of file record_surface_coverage.cpp.
providedPorts()
| static |
Declaration at line 60 of file record_surface_coverage.hpp, definition at line 202 of file record_surface_coverage.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.