Hello All,
I am trying to run following basic code
import argparse
import numpy as np
import os
import cv2
import vista
from vista.utils import transform
from vista.entities.agents.Dynamics import tireangle2curvature
trace_path = ["/home/parvez_alam/Downloads/vista_traces/20210726-131322_lexus_devens_center"]
def main(trace_path):
world = vista.World(trace_path, trace_config={'road_width': 4})
car = world.spawn_agent(
config={
'length': 5.,
'width': 2.,
'wheel_base': 2.78,
'steering_ratio': 14.7,
'lookahead_road': True
})
camera = car.spawn_camera(config={
'size': (200, 320),
})
display = vista.Display(world)
world.reset()
display.reset()
while not car.done:
action = follow_human_trajectory(car)
car.step_dynamics(action)
car.step_sensors()
vis_img = display.render()
cv2.imshow('Visualize RGB', vis_img[:, :, ::-1])
cv2.waitKey(20)
def follow_human_trajectory(agent):
action = np.array([
agent.trace.f_curvature(agent.timestamp),
agent.trace.f_speed(agent.timestamp)
])
return action
main(trace_path)
But it is showing following error
2023-08-01 16:24:26,442::WARNING::[vista.entities.sensors.EventCamera.] Fail to import module for event camera. Remember to do source /openeb/build/utils/scripts/setup_env.shCan ignore this if not using it
2023-08-01 16:24:27,060::WARNING::[vista.core.Trace._divide_to_good_segments] No video_label.csv
2023-08-01 16:24:28,728::WARNING::[vista.entities.sensors.Camera.reset] No flow data
Traceback (most recent call last):
File "vista1.py", line 54, in
main(trace_path)
File "vista1.py", line 37, in main
vis_img = display.render()
File "/home/parvez_alam/.local/lib/python3.8/site-packages/vista/core/Display.py", line 227, in render
patch = PolygonPatch(patch,
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 87, in PolygonPatch
return PathPatch(PolygonPath(polygon), **kwargs)
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 62, in PolygonPath
vertices = concatenate([
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 63, in
concatenate([asarray(t.exterior)[:, :2]] +
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed
Hello All, I am trying to run following basic code
But it is showing following error 2023-08-01 16:24:26,442::WARNING::[vista.entities.sensors.EventCamera.] Fail to import module for event camera. Remember to do source /openeb/build/utils/scripts/setup_env.shCan ignore this if not using it
2023-08-01 16:24:27,060::WARNING::[vista.core.Trace._divide_to_good_segments] No video_label.csv
2023-08-01 16:24:28,728::WARNING::[vista.entities.sensors.Camera.reset] No flow data
Traceback (most recent call last):
File "vista1.py", line 54, in
main(trace_path)
File "vista1.py", line 37, in main
vis_img = display.render()
File "/home/parvez_alam/.local/lib/python3.8/site-packages/vista/core/Display.py", line 227, in render
patch = PolygonPatch(patch,
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 87, in PolygonPatch
return PathPatch(PolygonPath(polygon), **kwargs)
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 62, in PolygonPath
vertices = concatenate([
File "/home/parvez_alam/.local/lib/python3.8/site-packages/descartes/patch.py", line 63, in
concatenate([asarray(t.exterior)[:, :2]] +
IndexError: too many indices for array: array is 0-dimensional, but 2 were indexed