Conversation
|
Hi @erblinium, thanks for the contribution. Being able to also publish calibration patterns sounds like a very good idea. Right now the code does not satisfy the code checker yet. And your changes contain a few unwanted indentation changes which makes it hard to add a review via GitHub. You could try to configure your IDE such that it automatically uses the provided Looking forward to add the review as soon as the code checker is happy. Kind regards |
| else if (type.asString() == valSingleCustom || type.asString() == valSingle) { | ||
| // Ensenso and halcon calibration type markers | ||
| marker.type = visualization_msgs::msg::Marker::CUBE; | ||
| auto grid_size_x = object[itmGridSize][0].asDouble(); | ||
| auto grid_size_y = object[itmGridSize][1].asDouble(); | ||
| auto grid_spacing = object[itmGridSpacing].asDouble(); | ||
|
|
||
| auto plate_width = std::round(0.5 * grid_size_x * grid_spacing / 0.9); | ||
| auto plate_height = std::round(0.5 * grid_size_y * grid_spacing / 0.9); | ||
|
|
||
| marker.scale.x = plate_width / 1000.0; | ||
| marker.scale.y = plate_height / 1000.0; | ||
| marker.scale.z = 3 / 1000.0; | ||
| } |
There was a problem hiding this comment.
This is how we internally distinguish between Halcon and Ensenso patterns and how we calculate the actual pattern size:
| else if (type.asString() == valSingleCustom || type.asString() == valSingle) { | |
| // Ensenso and halcon calibration type markers | |
| marker.type = visualization_msgs::msg::Marker::CUBE; | |
| auto grid_size_x = object[itmGridSize][0].asDouble(); | |
| auto grid_size_y = object[itmGridSize][1].asDouble(); | |
| auto grid_spacing = object[itmGridSpacing].asDouble(); | |
| auto plate_width = std::round(0.5 * grid_size_x * grid_spacing / 0.9); | |
| auto plate_height = std::round(0.5 * grid_size_y * grid_spacing / 0.9); | |
| marker.scale.x = plate_width / 1000.0; | |
| marker.scale.y = plate_height / 1000.0; | |
| marker.scale.z = 3 / 1000.0; | |
| } | |
| else if (object[itmGridSpacing].exists()) | |
| { | |
| // Halcon pattern spacing. | |
| auto spacing = object[itmGridSpacing].asDouble(); | |
| // Ensenso pattern spacing. | |
| if (type.exists() && type != "") | |
| { | |
| spacing /= 2; | |
| } | |
| auto width = object[itmGridSize][0].asDouble(); | |
| auto height = object[itmGridSize][1].asDouble(); | |
| auto thickness = object[itmThickness].exists() ? object[itmThickness].asDouble() : 3.; | |
| marker.type = visualization_msgs::msg::Marker::CUBE; | |
| marker.scale.x = (width + 1) * spacing / 1000.0; | |
| marker.scale.y = (height + 1) * spacing / 1000.0; | |
| marker.scale.z = thickness / 1000.0; | |
| } |
Add parsing of calibration plates in
virtual_object_handler