Repository navigation
pycvc_gl.cars.HostCars: the cars template's cars in a host's own world - #1341
Merged
Merged
Conversation
The cars template ran its cars on worlds of its own (cars.py's builders) or, with --gym, headless in pycvc.WorldGym's own app, which a drawn host cannot show. HostCars runs them in the world the host's own document runs, so a drawn host shows them as that document draws its world, with the interface Cars and GymCars have (state, step, step_navigator, new_goals, reset, world): a controller's (steer, accel) goes to each car as its intent (a replace command until the next call; a NaN leaves the car to nav@1), step_navigator clears them, and the rays are cast on the world's grid. pycvc.WorldEntities gains what that needs: set_goal(id, x, y), set_wander(on), grid() (as pycvc.WorldGym.grid gives it), and in each list() entry the entity's velocity, steering, goal, reach, reached, collided and its body (length, width, wheelbase and its limits). Test: test_pycvc_gl_host_cars (four cars spawned in a headless host's world, a CarsState with rays, nav@1 drives them toward their goals, the controller's command takes over and a NaN gives them back, new goals, reset); test_pycvc_world_entities and test_pycvc_gl_cars still pass.
The boat node's tests (AriadneBoatNode.FloatsSteersFromItsKeysAndNavTakesItToItsGoal and NavTakesTerrainLabsLaunchAcrossTheLake) took 156 and 77 s in master's Debug package job before #1318's inertial fluid, and ran past ctest's 300 s in #1335's, which builds on it; the crate drifting in the scene's wind timed out once there too. The binary's tests get 900 s, as the segmentation action test has. (cherry picked from commit dc5fff6)
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.
Track 3 of the local-world gaps, first part: the cars template can run its cars in the world a host's own document runs. The grl-snam ports will be rebuilt on this.
Why
The cars template ran its cars in one of two places. One was worlds of its own, built by
cars.py's builders. The other, with--gym, was headless insidepycvc.WorldGym's own app, which a drawn host can't show. So a drawn demo couldn't use the world runtime.Change
pycvc_gl.cars.HostCarsruns the cars in the host's own world, so a drawn host shows them as that document draws its world. It has the interfaceCarsandGymCarshave:state,step,step_navigator,new_goals,reset,world.(steer, accel)goes to each car as its intent: a replace command, kept until the next call. A NaN leaves that car to nav@1.step_navigatorclears the intents.pycvc.WorldEntitiesgains whatHostCarsneeds:set_goal(id, x, y),set_wander(on), andgrid()(inpycvc.WorldGym.grid's format). Eachlist()entry also carries the entity's velocity, steering, goal, reach,reached,collided, and its body (length, width, wheelbase, limits).ARIADNE.mdand thecars.pymodule docs describe them.Tests
test_pycvc_gl_host_cars(11 checks):CarsStatewith rays.test_pycvc_world_entities(38 checks) andtest_pycvc_gl_cars(67 checks) still pass, on a Windows Release build.Not yet
--gymis still headless only. Switching the template's default onto world documents comes with the demo rebuilds, where each port moves toHostCarsorGymCars.