Repository navigation
OW5n: a vehicle's spin and steering in its pose - #1488
Merged
Merged
Conversation
A dynamic4w model takes its suspension's pitch and roll from each sample that carries them (the relay's box, OW5m) and its heave from the box's height (dyn_4w_plant::box_pose inverted). The rates of heave, roll and pitch stay the model's: the pose stream carries no roll or pitch rate, and its vertical speed is the box's after the relay's step under gravity. A heading-only sample keeps the predicted suspension. A client joining a four-wheel vehicle mid-turn is now within 24-26 mrad of its attitude (94-98 before) and 0.3-1.2 mm of its height (1.7-10). drive_as_the_world_does gains sampled_too and join for the new AriadneOneWorld.AClientJoinsAFourWheelVehicleMidTurn.
The pose stream carries each entry's angular velocity (mrad/s) and a vehicle's steering angle (microradians), delta-encoded like the rest (PoseEntry.wx, wy, wz, steer). PoseSnapshot.carries says the relay sends them (kCarriesMotion); a relay before this leaves it 0, so its zeros read as not known, not as not turning, and a client keeps its model's values. The relay fills them from the chassis body (entity_ride's angular velocity) and the plant's steering (entity_info::steer; holon::steer for a driver). A client's sample carries them (pose_sample::steer) through holon::apply_authoritative to dynamic_vehicle_model::at: the dynamic plants take the steering angle and yaw rate, dynamic4w the roll and pitch rates too, a jolt or boat model its chassis's spin. A client joining a four-wheel Humvee mid-turn, through the pose stream, is now within 0.7 mrad of its attitude and 0.3 mrad of its heading (24-25 and 10.4 with the attitude alone). The jolt Humvee is within 1.1 mrad (3.7); the boat on the waves within 3.6 mm of height (4.7). The waves test's phase check now skews by a second (15 mm of drift) rather than half (8 mm).
A jolt or boat model's world holds a box for each of the room's vehicles the client shows (dynamic_vehicle_model::hold_obstacles, from holon::held_obstacles). Before each step each goes where its vehicle is to be at the step's end, along its velocity, as the walker's world holds them. A kinematic-plant vehicle is a kinematic box. A vehicle the relay can push (a jolt vehicle, a dynamic plant's box) is a body of its mass (room_entity::dynamics, through hold_entity's new mass), put where it is shown before each step, so the car shoves it as the relay's does. The boxes are made with the model's world (obstacle_room: one per vehicle held and two spares of each size and mass), since world::restore needs the same bodies. When more come into view than it has room for, the holon makes the model again with room (vehicle_rebuilds). Held entities now count their steps while the participant drives, too. The relay's car into a parked vehicle, sampled every 4 ticks through the pose stream: the model is within 3.9 mm holding its box, 50 mm without (kinematic plant); 3.9 mm and 21 mm for a jolt Humvee shoved 4 m.
OW5o: the room's vehicles in the car a client drives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OW5's fourteenth slice (ARIADNE_WORLDS.md §18.5). The relay's poses now carry a vehicle's angular velocity and steering angle, and a client's models take them, along with the four-wheel suspension, from each sample. A client that starts predicting a vehicle the relay is already driving starts it as the relay has it: not level, not still, and not with its wheels straight. Stacked on #1484.
What changed
PoseEntrygainswx, wy, wz(angular velocity, mrad/s) andsteer(a vehicle's steering angle, microradians). They are sent as differences, like the other fields, so a vehicle going straight costs nothing extra.PoseSnapshot.carries(bitkCarriesMotion) says the relay sends them. A relay from before this leaves it 0, so a client reads its zeros as "not known", not as "not turning", and keeps its model's values.entity_ride);entity_info::steer, and the newholon::steerfor a driver's pose).pose_sample::steer(set when the snapshot carries them) goes throughholon::apply_authoritativetodynamic_vehicle_model::at:dyn_4w_plant::box_poseinverted).Why it needed the steering
With the attitude alone, a client joining mid-turn was still 24 mrad off. I traced it to the front wheels: the model started them straight, and they took half a second to reach the relay's angle, during which the roll rate drifted. In a test, I gave the model the relay's steering angle and rates at each sample:
Tests
AriadneOneWorld.AClientJoinsAFourWheelVehicleMidTurn: the client starts its model partway through the drive, with samples every 4 ticks, now through the real pose stream (quantized).at()sets the steering angle and rates from a sample that carries them, and keeps the predicted values without.drive_as_the_world_doesnow passes every relay update throughpose_stream_encoderandpose_stream_decoder. This affects all the plants' sampled runs:HolonVehicleTest.ASampleCarriesTheSteeringToTheModel: on both dynamic plants, a sample with steering places the holon's model with the relay's steering angle and yaw rate; one without places it straight.PoseStream.AVehiclesSpinAndSteeringRideTheStream: the new fields round-trip, a change of steering alone produces an entry, and a snapshot withoutcarriesgives no steering and zero spin.carries, and their comparison checks them.Not verified
__std_rotate) this MSVC 14.44 toolset lacks. CI runs them.Not done yet
reconcile_tol. So a model that is close in position but has a different steering angle isn't corrected until it drifts.