Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'LidarDetection' object has no attribute 'x' #46

Open
xiaowang304 opened this issue Oct 9, 2022 · 5 comments
Open

AttributeError: 'LidarDetection' object has no attribute 'x' #46

xiaowang304 opened this issue Oct 9, 2022 · 5 comments

Comments

@xiaowang304
Copy link

Traceback (most recent call last):
File "C:/Users/wxk/Desktop/saccode/carla/test.py", line 55, in
main()
File "C:/Users/wxk/Desktop/saccode/carla/test.py", line 44, in main
obs = env.reset()
File "C:\Users\wxk\anaconda3\envs\highway\lib\site-packages\gym\wrappers\order_enforcing.py", line 42, in reset
return self.env.reset(**kwargs)
File "C:\Users\wxk\anaconda3\envs\highway\lib\site-packages\gym\wrappers\env_checker.py", line 47, in reset
return passive_env_reset_check(self.env, **kwargs)
File "C:\Users\wxk\anaconda3\envs\highway\lib\site-packages\gym\utils\passive_env_checker.py", line 238, in passive_env_reset_check
result = env.reset(**kwargs)
File "C:\Users\wxk\anaconda3\envs\highway\lib\site-packages\gym_carla-0.0.1-py3.8.egg\gym_carla\envs\carla_env.py", line 255, in reset
File "C:\Users\wxk\anaconda3\envs\highway\lib\site-packages\gym_carla-0.0.1-py3.8.egg\gym_carla\envs\carla_env.py", line 496, in _get_obs
AttributeError: 'LidarDetection' object has no attribute 'x'

@slowdive500
Copy link

Maybe ur CARLA version like me, is not 0.9.6.
u can try add 'location = location.point' before 'point_cloud.append([location.x, location.y, -location.z])' at line 499 in 'carla_env.py'.

@Tangzj2020
Copy link

This problem is that your CARLA version is not 0.9.6, more like 0.9.8 or 0.9.10.

@Tangzj2020
Copy link

Tangzj2020 commented Dec 6, 2022

@xiaowang304 your CARLA version look at not 0.9.6, other version I've solved this problem with this setting: change this line,
point_cloud.append([location.x, location.y, -location.z])
to the line,
point_cloud.append([location.point.x, location.point.y, location.point.z])
at line 499 in 'carla_env.py'.

@Derkai52
Copy link

Derkai52 commented Mar 17, 2023

More precisely, in Carla0.9.14, this should be changed to
point_cloud.append([location.point.y, -location.point.x,-location.point.z])
to ensure that the visualization is correct at the same time

@sunaining
Copy link

I met the same question too,however it's no use for me when I change the code, and my brand is 0.9.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants