void SSLField::loadFieldGeometryFromNetwork(const SSL_GeometryFieldSize &fieldSize) { line_width = fieldSize.line_width(); field_length = fieldSize.field_length(); field_width = fieldSize.field_width(); boundary_width = fieldSize.boundary_width(); referee_width = fieldSize.referee_width(); goal_width = fieldSize.goal_width(); goal_depth = fieldSize.goal_depth(); goal_wall_width = fieldSize.goal_wall_width(); center_circle_radius = fieldSize.center_circle_radius(); defense_radius = fieldSize.defense_radius(); defense_stretch = fieldSize.defense_stretch(); free_kick_from_defense_dist = fieldSize.free_kick_from_defense_dist(); penalty_spot_from_field_line_dist = fieldSize.penalty_spot_from_field_line_dist(); penalty_line_from_spot_dist = fieldSize.penalty_line_from_spot_dist(); }
void SoccerView::LoadFieldGeometry ( SSL_GeometryFieldSize &fieldSize ) { this->line_width = fieldSize.line_width(); this->field_length = fieldSize.field_length(); this->field_width = fieldSize.field_width(); this->boundary_width = fieldSize.boundary_width(); this->referee_width = fieldSize.referee_width(); this->goal_width = fieldSize.goal_width(); this->goal_depth = fieldSize.goal_depth(); this->goal_wall_width = fieldSize.goal_wall_width(); this->center_circle_radius = fieldSize.center_circle_radius(); this->defense_radius = fieldSize.defense_radius(); this->defense_stretch = fieldSize.defense_stretch(); this->free_kick_from_defense_dist = fieldSize.free_kick_from_defense_dist(); this->penalty_spot_from_field_line_dist = fieldSize.penalty_spot_from_field_line_dist(); this->penalty_line_from_spot_dist = fieldSize.penalty_line_from_spot_dist(); scene->removeItem ( fieldItem ); ConstructField(); fieldItem = scene->addPath ( *field,*fieldLinePen,*fieldBrush ); }
void PluginLegacyPublishGeometry::sendGeometry() { // NOTE: The field dimensions are derived from one half irrespective of // the exact field half / end in question. SSL_GeometryFieldSize field; _field.toProtoBuffer(field); // Geometry data for double-sized field in old format. RoboCup2014Legacy::Geometry::SSL_GeometryData ds_geodata_old; // Field data for double-sized field in old format. RoboCup2014Legacy::Geometry::SSL_GeometryFieldSize ds_field_old; ds_field_old.set_field_length(field.field_length()); ds_field_old.set_field_width(field.field_width()); ds_field_old.set_goal_width(field.goal_width()); ds_field_old.set_goal_depth(field.goal_depth()); ds_field_old.set_boundary_width(field.boundary_width()); ds_field_old.set_center_circle_radius( GetFieldCircularArcRadius("CenterCircle")); ds_field_old.set_defense_radius( GetFieldCircularArcRadius("LeftFieldLeftPenaltyArc")); ds_field_old.set_defense_stretch(GetFieldLineLength("LeftPenaltyStretch")); // The following fields no longer exist in ssl-vision, and are hard-coded // from the ssl-vision SVN trunk, r233. ds_field_old.set_line_width(10); ds_field_old.set_referee_width(425); ds_field_old.set_goal_wall_width(20); ds_field_old.set_free_kick_from_defense_dist(200); ds_field_old.set_penalty_spot_from_field_line_dist(750); ds_field_old.set_penalty_line_from_spot_dist(400); *ds_geodata_old.mutable_field() = ds_field_old; // Copy over the camera calibrations. for (unsigned int i = 0; i < params.size(); i++) { SSL_GeometryCameraCalibration* ds_calib_old = ds_geodata_old.add_calib(); params[i]->toProtoBuffer(*ds_calib_old,i); } _ds_udp_server_old->sendLegacyMessage(ds_geodata_old); }