Skip to content

Commit

Permalink
Make fixes based on the review.
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Liberadzki <[email protected]>
  • Loading branch information
PawelLiberadzki committed Jun 11, 2024
1 parent ddb6219 commit 39f3a2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions include/rgl/api/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,10 @@ RGL_API rgl_status_t rgl_node_points_radar_postprocess(rgl_node_t* node, const r
/**
* Creates or modifies RadarTrackObjectsNode.
* The Node takes radar detections point cloud as input (from rgl_node_points_radar_postprocess), groups detections into objects based on given thresholds (node parameters),
* and calculates various characteristics of these objects. This Node is intended to be connected to object list publishing node (from rgl_node_publish_udp_objectlist).
* The output from this Node is in the form of a point cloud, where point XYZ coordinates are tracked objects positions. Additionally, cloud points have tracked object IDs.
* Note that for correct calculation and publishing some of object characteristics (e.g. velocity) user has to call rgl_scene_set_time for current scene.
* Graph input: point cloud, containing RGL_FIELD_DISTANCE_F32, RGL_FIELD_AZIMUTH_F32, RGL_FIELD_ELEVATION_F32 and RGL_FIELD_RADIAL_SPEED_F32
* and calculates various characteristics of these objects. The output from this Node is in the form of a point cloud, where point XYZ coordinates are tracked objects positions.
* Additionally, cloud points have tracked object IDs. Note that for correct calculation and publishing some of object characteristics (e.g. velocity) user has to call
* rgl_scene_set_time for current scene.
* Graph input: point cloud, containing additionally RGL_FIELD_DISTANCE_F32, RGL_FIELD_AZIMUTH_F32, RGL_FIELD_ELEVATION_F32, RGL_FIELD_RADIAL_SPEED_F32 and ENTITY_ID_I32.
* Graph output: point cloud, contains only XYZ_VEC3_F32 for tracked object positions and ENTITY_ID_I32 for their IDs.
* @param node If (*node) == nullptr, a new Node will be created. Otherwise, (*node) will be modified.
* @param object_distance_threshold The maximum distance between a radar detection and other closest detection classified as the same tracked object (in meters).
Expand All @@ -889,6 +889,8 @@ RGL_API rgl_status_t rgl_node_points_radar_track_objects(rgl_node_t* node, float
/**
* Modifies RadarTrackObjectsNode to set entity ids to radar object classes mapping.
* This is necessary to call for RadarTrackObjectsNode to classify tracked objects correctly. If not set, objects will be classified as RGL_RADAR_CLASS_UNKNOWN by default.
* Note that entity can only belong to a single class - passing entity id multiple times in entity_ids array will result in the last version to be assigned. There is no
* limit on how many entities can have the same class.
* @param node RadarTrackObjectsNode to modify.
* @param entity_ids Array of RGL entity ids.
* @param object_classes Array of radar object classes.
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ RGL_API rgl_status_t rgl_node_points_radar_set_classes(rgl_node_t node, const in
RadarTrackObjectsNode::Ptr trackObjectsNode = Node::validatePtr<RadarTrackObjectsNode>(node);
trackObjectsNode->setObjectClasses(entity_ids, object_classes, count);
});
TAPE_HOOK(node, entity_ids, object_classes, count);
TAPE_HOOK(node, TAPE_ARRAY(entity_ids, count), TAPE_ARRAY(object_classes, count), count);
return status;
}

Expand Down
6 changes: 6 additions & 0 deletions test/src/TapeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ TEST_F(TapeTest, RecordPlayAllCalls)
rgl_node_t radarTrackObjects = nullptr;
EXPECT_RGL_SUCCESS(rgl_node_points_radar_track_objects(&radarTrackObjects, 2.0f, 0.1f, 0.1f, 0.5f, 1.0f, 500.0f, 0.01f));

std::vector<Field<ENTITY_ID_I32>::type> entityIds = {1, 2, 3};
std::vector<rgl_radar_object_class_t> objectClasses = {RGL_RADAR_CLASS_CAR, RGL_RADAR_CLASS_TRUCK,
RGL_RADAR_CLASS_MOTORCYCLE};
EXPECT_RGL_SUCCESS(
rgl_node_points_radar_set_classes(radarTrackObjects, entityIds.data(), objectClasses.data(), entityIds.size()));

rgl_node_t filterGround = nullptr;
rgl_vec3f sensorUpVector = {0.0f, 1.0f, 0.0f};
EXPECT_RGL_SUCCESS(rgl_node_points_filter_ground(&filterGround, &sensorUpVector, 0.1f));
Expand Down

0 comments on commit 39f3a2f

Please sign in to comment.