Skip to main content

Module sim

Module sim 

Source
Expand description

A machine, its controller and the integrator, stepped together. Every front end runs this.

Structs§

Contact
The first contact of a run with an obstacle: when (the end of the base step that found it, s), at which tool pose, how fast the tool went into it (the length of its speed vector at the start of that step, before a push braked it, axis units per second) and which obstacle. With effects.crash, from then on: the largest force of the obstacles on the machine (N) and the impact energy, the most work their pushes had taken out of the machine at any time (J; at the deepest point of a blocked impact, the kinetic energy the impact took).
HeatedPart
A part of the machine that warms with its loss power (Machine::thermal_parts, effects.part_heating): one thermal mass with a thermal resistance R to its surroundings, so that its temperature rise follows tau d(rise)/dt = R P - rise and settles at R P under a steady loss P.
PathRun
A path in place of the cycle ([path] of a config, see with_path): the text of a path file or a program (program::read), the file name that says which reader takes it, and whether it is timed as fast as the motors allow.
Sim
Snapshot
What a running simulation has come to apart from its machine (Sim::snapshot): the integrated state, the controller with its drives (loops, filters, windings, thermal and overload images), the parts’ warmth and the obstacle record. Sim::restore takes it back into a simulation built from the same machine and config; what the machine itself keeps between steps (payload, brakes, dwelling, the parts’ temperatures, its memory) is set again from it.

Constants§

OWN_PARTS_EVERY_S
How often the run looks at the machine’s own parts (Sim::own_parts), s: a look draws the machine’s parts, which on an arm costs about as much as a step. At 1 m/s the machine moves a millimetre in this time, the planned path’s spacing.

Functions§

config_hint
Config::hint with the keys set_config_text may add among those a misspelt one is near.
heats
Whether the parts warm with their losses: effects.part_heating, or effects.thermal_feedback, which needs their temperatures.
load_config
A config file for a machine, as a front end loads it. The machine’s default config is the schema: a key it does not have is refused by name, so that a misspelt key cannot pass silently. [bounds] has its own check (analysis::bounds), and a rating that the default config leaves out may be there.
schema
The keys a config for entry may have: its default config’s, and a motor’s own table ([motor.<id>] and the rest of catalog::PER_MOTOR_TABLES) for every motor of the machine cfg builds and any motor cfg gives one, with the shared table’s keys, though the default has none for that motor (a seven-joint URDF on the arm whose default has six). An id of a table that the machine built from cfg has no motor of is refused (ConfigError::Invalid with <table>.<id>), so a misspelt one is not silently unread. Where cfg does not build, the ids are not checked here: building it reports that error itself.
set_config
set_config_text for Config::set.
set_config_text
Config::set_text on a config of entry, which also adds a key the config has not got where a file of it may have it (load_config): a motor’s own value of a shared key (drive.<id>.velocity_kp_nm_s_rad), a key of analysis::RATINGS_BEYOND_DEFAULT. A misspelt key is refused as by set_text.
with_path
The config with [path] set: the analysis of the cycle runs this path (file name and text, as --path FILE reads it) instead, timed within the axis limits or with time_optimal as fast as the motors allow. An optional table (analysis::RATINGS_BEYOND_DEFAULT): a config without it runs its cycle.