JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::BallGamepieceSim::FieldConfig Struct Reference

Global field and contact tuning parameters. More...

#include <ball_gamepiece_sim.hpp>

Public Attributes

Vector3 min_corner_m {0.0, 0.0, 0.0}
Vector3 max_corner_m {16.54, 8.21, 3.0}
double wall_restitution {0.25}
double wall_restitution_reference_speed_mps {3.0}
double wall_restitution_speed_exponent {0.15}
double wall_restitution_min_scale {0.55}
double wall_friction {0.2}
int net_boundary_user_id {-1}
double net_entry_slack_scale {0.7}
double net_velocity_decay {0.2}
double net_spin_decay {0.8}
double net_downward_bias_mps2 {2.0}
double robot_ball_contact_restitution {0.45}
double robot_ball_restitution_reference_speed_mps {3.0}
double robot_ball_restitution_speed_exponent {0.15}
double robot_ball_restitution_min_scale {0.55}
double robot_ball_contact_friction {0.2}
bool scoring_element_snapping_enabled {false}
double snap_distance_m {0.1}
double ball_ball_contact_restitution {0.45}
double ball_ball_contact_friction {0.2}
double ball_ball_restitution_reference_speed_mps {3.0}
double ball_ball_restitution_speed_exponent {0.15}
double ball_ball_restitution_min_scale {0.55}
double ball_ball_spin_transfer_gain {0.18}
double free_ball_spin_decay_per_s {0.35}
bool ccd_enabled {true}
double ccd_speed_threshold_mps {10.0}
bool sleeping_enabled {true}
double sleep_velocity_threshold_mps {0.05}
double sleep_spin_threshold_radps {0.8}
int sleep_frame_threshold {12}
int solver_iterations {4}
double baumgarte_beta {0.2}
double baumgarte_slop_m {0.005}

Detailed Description

Global field and contact tuning parameters.

Member Data Documentation

◆ ball_ball_contact_friction

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_contact_friction {0.2}

Friction used for grounded ball-ball collision impulse.

◆ ball_ball_contact_restitution

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_contact_restitution {0.45}

Restitution used for grounded ball-ball collision impulse.

◆ ball_ball_restitution_min_scale

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_restitution_min_scale {0.55}

Minimum fraction of base restitution retained at very high speeds.

◆ ball_ball_restitution_reference_speed_mps

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_restitution_reference_speed_mps {3.0}

Reference impact speed for velocity-dependent ball-ball restitution.

◆ ball_ball_restitution_speed_exponent

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_restitution_speed_exponent {0.15}

Exponent used when scaling restitution above reference impact speed.

◆ ball_ball_spin_transfer_gain

double frcsim::BallGamepieceSim::FieldConfig::ball_ball_spin_transfer_gain {0.18}

Fraction of tangential collision impulse converted into ball spin.

◆ baumgarte_beta

double frcsim::BallGamepieceSim::FieldConfig::baumgarte_beta {0.2}

Baumgarte stabilization factor used to reduce penetration.

◆ baumgarte_slop_m

double frcsim::BallGamepieceSim::FieldConfig::baumgarte_slop_m {0.005}

Allowed penetration before stabilization is applied, in meters.

◆ ccd_enabled

bool frcsim::BallGamepieceSim::FieldConfig::ccd_enabled {true}

Enables continuous collision checks for fast-moving balls.

◆ ccd_speed_threshold_mps

double frcsim::BallGamepieceSim::FieldConfig::ccd_speed_threshold_mps {10.0}

Speed threshold above which CCD checks are evaluated, in meters per second.

◆ free_ball_spin_decay_per_s

double frcsim::BallGamepieceSim::FieldConfig::free_ball_spin_decay_per_s {0.35}

Exponential-like free spin decay applied while balls are not held.

◆ max_corner_m

Vector3 frcsim::BallGamepieceSim::FieldConfig::max_corner_m {16.54, 8.21, 3.0}

Maximum field corner in world coordinates.

◆ min_corner_m

Vector3 frcsim::BallGamepieceSim::FieldConfig::min_corner_m {0.0, 0.0, 0.0}

Minimum field corner in world coordinates.

◆ net_boundary_user_id

int frcsim::BallGamepieceSim::FieldConfig::net_boundary_user_id {-1}

If >= 0, box boundaries with this user_id behave as net/catcher volumes.

◆ net_downward_bias_mps2

double frcsim::BallGamepieceSim::FieldConfig::net_downward_bias_mps2 {2.0}

Additional downward acceleration bias for captured net balls.

◆ net_entry_slack_scale

double frcsim::BallGamepieceSim::FieldConfig::net_entry_slack_scale {0.7}

Effective slack around net box volumes when determining entry.

◆ net_spin_decay

double frcsim::BallGamepieceSim::FieldConfig::net_spin_decay {0.8}

Spin decay multiplier applied while a ball is in a net volume.

◆ net_velocity_decay

double frcsim::BallGamepieceSim::FieldConfig::net_velocity_decay {0.2}

Planar velocity scale applied each step while a ball is in a net volume.

◆ robot_ball_contact_friction

double frcsim::BallGamepieceSim::FieldConfig::robot_ball_contact_friction {0.2}

Friction used for robot-ball collision impulse.

◆ robot_ball_contact_restitution

double frcsim::BallGamepieceSim::FieldConfig::robot_ball_contact_restitution {0.45}

Restitution used for robot-ball collision impulse.

◆ robot_ball_restitution_min_scale

double frcsim::BallGamepieceSim::FieldConfig::robot_ball_restitution_min_scale {0.55}

Minimum fraction of robot-ball restitution retained at high speeds.

◆ robot_ball_restitution_reference_speed_mps

double frcsim::BallGamepieceSim::FieldConfig::robot_ball_restitution_reference_speed_mps {3.0}

Reference impact speed for velocity-dependent robot-ball restitution.

◆ robot_ball_restitution_speed_exponent

double frcsim::BallGamepieceSim::FieldConfig::robot_ball_restitution_speed_exponent {0.15}

Exponent used when scaling robot-ball restitution above reference speed.

◆ scoring_element_snapping_enabled

bool frcsim::BallGamepieceSim::FieldConfig::scoring_element_snapping_enabled {false}

Enable automatic snapping of game elements to scoring zones when within snap_distance_m. Used for pick-and-place games or ball scoring where the element disappears and is added to a hub-like device, then teleported out X seconds later.

◆ sleep_frame_threshold

int frcsim::BallGamepieceSim::FieldConfig::sleep_frame_threshold {12}

Consecutive qualifying frames required before sleeping.

◆ sleep_spin_threshold_radps

double frcsim::BallGamepieceSim::FieldConfig::sleep_spin_threshold_radps {0.8}

Maximum spin magnitude for sleep candidacy.

◆ sleep_velocity_threshold_mps

double frcsim::BallGamepieceSim::FieldConfig::sleep_velocity_threshold_mps {0.05}

Maximum linear speed for sleep candidacy.

◆ sleeping_enabled

bool frcsim::BallGamepieceSim::FieldConfig::sleeping_enabled {true}

Enables sleeping/wake logic for nearly resting balls.

◆ snap_distance_m

double frcsim::BallGamepieceSim::FieldConfig::snap_distance_m {0.1}

Distance threshold for automatic snapping to scoring zones, in meters.

◆ solver_iterations

int frcsim::BallGamepieceSim::FieldConfig::solver_iterations {4}

Number of sequential-impulse iterations for contact solving.

◆ wall_friction

double frcsim::BallGamepieceSim::FieldConfig::wall_friction {0.2}

Fractional tangential damping applied on wall contacts.

◆ wall_restitution

double frcsim::BallGamepieceSim::FieldConfig::wall_restitution {0.25}

Coefficient applied to wall-normal bounce response.

◆ wall_restitution_min_scale

double frcsim::BallGamepieceSim::FieldConfig::wall_restitution_min_scale {0.55}

Minimum fraction of wall restitution retained at high impact speeds.

◆ wall_restitution_reference_speed_mps

double frcsim::BallGamepieceSim::FieldConfig::wall_restitution_reference_speed_mps {3.0}

Reference impact speed for velocity-dependent wall restitution.

◆ wall_restitution_speed_exponent

double frcsim::BallGamepieceSim::FieldConfig::wall_restitution_speed_exponent {0.15}

Exponent used when scaling wall restitution above reference speed.


The documentation for this struct was generated from the following file: