mirror of
https://github.com/aurora-opensource/xviz.git
synced 2026-01-18 14:07:46 +00:00
* update circle example scenario after python module rename * add alpha channel for colors so that the 3 points display properly. * fix some issues with glb writing, and add some more tests * add script to write a scenario to files on disk * add support for converting polygon and polyline vertices into typed arrays in binary format * add floating polygon to circle example scenario * make server print out exception and stack trace
32 lines
702 B
Python
32 lines
702 B
Python
import sys, os, logging
|
|
import asyncio, json
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
import xviz_avs
|
|
from xviz_avs.io import XVIZGLBWriter, DirectorySource
|
|
|
|
from scenarios.circle import CircleScenario
|
|
|
|
|
|
OUTPUT_DIR = './output/'
|
|
|
|
|
|
def main():
|
|
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
|
sink = DirectorySource(OUTPUT_DIR)
|
|
writer = XVIZGLBWriter(sink)
|
|
duration = 10
|
|
scenario = CircleScenario(live=False, duration=duration)
|
|
writer.write_message(scenario.get_metadata())
|
|
t = 0
|
|
while t <= duration:
|
|
message = scenario.get_message(t)
|
|
writer.write_message(message)
|
|
t += 0.2
|
|
writer.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|