Conversation
Corresponding rule update: RoboCup-SSL/ssl-rules#103 - Split variable Field_Margin, making it possible to set both `Field_Margin_Goal_Line` and `Field_Margin_Touch_Line` separately. - Set DivA_Field_Margin_Goal_line to 0.6m, set the others to 0.3m - Replace usage of `ConfigWidget::Field_Margin()` to corresponding one (`ConfigWidget::Field_Margin_Touch_Line()` or `ConfigWidget::Field_Margin_Goal_Line()`) - Update goal side walls to extend to the outside wall
There was a problem hiding this comment.
Pull request overview
Updates grSim’s field geometry configuration to support different margins along the touch lines vs behind the goal lines (per the 2026 rules update), and adjusts camera/wall placement accordingly.
Changes:
- Split field margin into
Field_Margin_Touch_LineandField_Margin_Goal_Line(Div A goal-line margin defaulted to 0.6m). - Update camera positioning and wall placement code paths to use the appropriate margin component.
- Adjust goal side-wall geometry so side walls extend further toward the outside boundary.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sslworld.cpp | Uses split margins for viewpoint, bounding walls, goal-wall geometry, and geometry packet boundary width. |
| src/glwidget.cpp | Updates camera mode viewpoints to use touch-line vs goal-line margin appropriately. |
| src/mainwindow.cpp | Hooks restart logic to the two new margin variables for Div A and Div B. |
| src/configwidget.cpp | Adds UI/config variables for the two margins in Div A/Div B geometry settings. |
| include/configwidget.h | Replaces the single Field_Margin field accessor with touch-line and goal-line variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/configwidget.cpp
Outdated
| ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") | ||
| ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") |
There was a problem hiding this comment.
DivB margin vars are being added to div_a_vars instead of div_b_vars, which will place Division B settings under the Division A tree and likely prevent Division B margin values from being saved/loaded/configured correctly. Add these two ADD_VALUE entries to div_b_vars (like the surrounding DivB field settings).
| ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") | |
| ADD_VALUE(div_a_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") | |
| ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Touch_Line,0.3,"Margin along the touch lines") | |
| ADD_VALUE(div_b_vars, Double, DivB_Field_Margin_Goal_Line,0.3,"Margin behind the goal lines") |
| field->set_field_length(CONVUNIT(cfg->Field_Length())); | ||
| field->set_field_width(CONVUNIT(cfg->Field_Width())); | ||
| field->set_boundary_width(CONVUNIT(cfg->Field_Margin())); | ||
| field->set_boundary_width(CONVUNIT(cfg->Field_Margin_Touch_Line())); |
There was a problem hiding this comment.
field->set_boundary_width(...) now uses only Field_Margin_Touch_Line(), but the simulation walls use Field_Margin_Goal_Line() for the goal-line side and Field_Margin_Touch_Line() for the touch-line side. This makes the geometry packet inconsistent with the actual simulated boundary on the goal lines (especially for Div A where the margins differ). Consider using a conservative single value (e.g., the max of the two margins) or otherwise documenting/handling that the protocol only supports a single boundary width.
| field->set_boundary_width(CONVUNIT(cfg->Field_Margin_Touch_Line())); | |
| // Use a conservative single boundary width based on both touch-line and goal-line margins | |
| double boundary_width = cfg->Field_Margin_Touch_Line(); | |
| double goal_line_margin = cfg->Field_Margin_Goal_Line(); | |
| if (goal_line_margin > boundary_width) { | |
| boundary_width = goal_line_margin; | |
| } | |
| field->set_boundary_width(CONVUNIT(boundary_width)); |
src/sslworld.cpp
Outdated
| const double gsiz_x = cfg->Field_Margin_Goal_Line(); | ||
| const double gsiz_y = cfg->Goal_Width(); | ||
| const double gsiz_z = cfg->Goal_Height(); | ||
| const double gpos2_x = (cfg->Field_Length() + gsiz_x) / 2.0; | ||
|
|
||
| const double gpos2_x = (cfg->Field_Length() + cfg->Field_Margin_Goal_Line() + cfg->Field_Line_Width()) / 2.0; |
There was a problem hiding this comment.
Goal side walls are intended to “extend to the outside wall”, but their X extent/position is based only on Field_Margin_Goal_Line() (+ half line width) and ignores Field_Referee_Margin() and the bounding wall thickness used in the outer wall placement. If Field_Referee_Margin() is non-zero, these goal side walls will no longer reach the outer wall and a gap will appear. Compute the goal side wall length/center from the actual outer wall inner face (derived from pos_x/thick) so the pieces always meet.
|
Thx for the contribution :) Very welcome. Besides the copilot remarks: Can you also update the geometry protobuf message and sent out the separate boundary widths? |
and set `cfg->Field_Margin_Goal_Line()` on `generatePacket()` fef: RoboCup-SSL/ssl-vision#234
Add field value `Field_Goal_Substitution_Area_Width` - Div.A: 0.3m - Div.B: 0.0m (non available) set the value on `generatePacket()` ref: fef: RoboCup-SSL/ssl-vision#234
|
Thank you for review, revised as suggested and updated .proto file referring RoboCup-SSL/ssl-vision#234 . |
Issue or RFC Endorsed by GrSim's Maintainers
Corresponding rule update: RoboCup-SSL/ssl-rules#103
Description of the Change
Field_Margin_Goal_LineandField_Margin_Touch_Lineseparately.ConfigWidget::Field_Margin()to corresponding one (ConfigWidget::Field_Margin_Touch_Line()orConfigWidget::Field_Margin_Goal_Line())Alternate Designs
N/A
Possible Drawbacks
On first startup, incorrect value for
Field Marginwill be loaded from ~/.grsim.xml if exists.Verification Process
Release Notes
Change size of field margin behind the goal lines for Div.A and adjust goal side walls to meet the rule change RoboCup-SSL/ssl-rules#103