Comments (9)
The arguments to VehicleControl should be float values, seems like you are passing float arrays to it instead.
from carla.
The arguments to VehicleControl should be float values, seems like you are passing float arrays to it instead.
In that case I get the following:
Assertion failed: (_clients.find(token.get_stream_id())) ==(_clients.end()), file C:\workspace\carla\LibCarla\cmake\..\source\carla/streaming/low_level/Client.h, line 56
:/
from carla.
@catarinam93 As @GoodarzMehr has said this error means there is a mismatch in the python arguments types your are sending to the carla.VehicleControl
.
From your code it seems you are using a numpy.float32
type instead of float
. Please, convert these values to float
first:
ego_vehicle_control = carla.VehicleControl(throttle=float(linear_velocity), steer=float(angular_velocity))
from carla.
@catarinam93 As @GoodarzMehr has said this error means there is a mismatch in the python arguments types your are sending to the
carla.VehicleControl
.From your code it seems you are using a
numpy.float32
type instead offloat
. Please, convert these values tofloat
first:ego_vehicle_control = carla.VehicleControl(throttle=float(linear_velocity), steer=float(angular_velocity))
Passing as floats I get the following:
Assertion failed: (_clients.find(token.get_stream_id())) ==(_clients.end()), file C:\workspace\carla\LibCarla\cmake..\source\carla/streaming/low_level/Client.h, line 56
What should I do?
from carla.
Can you print the full stack trace please? It's hard to know what happened based on a single line of error.
from carla.
Can you print the full stack trace please? It's hard to know what happened based on a single line of error.
C:\Users\Caty\Documents\Transfer-Reinforcement-Learning-for-Enhanced-Autonomy-in-Vehicles>python main.py INFO: Found the required file in cache! Carla/Maps/Nav/Town01.bin INFO: Connection has been setup successfully. INFO: Found the required file in cache! Carla/Maps/TM/Town01.bin Car Spawned Path Generated Sensors Spawned Using cpu device Wrapping the env with a
Monitor wrapper Wrapping the env in a DummyVecEnv. Assertion failed: (_clients.find(token.get_stream_id())) == (_clients.end()), file C:\workspace\carla\LibCarla\cmake\..\source\carla/streaming/low_level/Client.h, line 56
I am using a gymnasium environment btw
from carla.
Since the error is somewhat coming out of nowhere, using the traceback package might be helpful in debugging the code. You can use something like this in your main file:
try:
...
except Exception:
print(traceback.format_exc())
Given where the error is coming from, there is a good chance it is unrelated to VehicleControl
and perhaps more related to how you've set up your Gymnasium environment. I've used VehicleControl
in a Gymnasium environment before and everything worked fine (I was using Ubuntu though, don't know about Windows).
from carla.
Since the error is somewhat coming out of nowhere, using the traceback package might be helpful in debugging the code. You can use something like this in your main file:
try: ... except Exception: print(traceback.format_exc())Given where the error is coming from, there is a good chance it is unrelated to
VehicleControl
and perhaps more related to how you've set up your Gymnasium environment. I've usedVehicleControl
in a Gymnasium environment before and everything worked fine (I was using Ubuntu though, don't know about Windows).
I did that (I think:)) in my main file:
`...
try:
# ----------------------------------------------- PPO Algorithm ----------------------------------------------
ppo = PPO(policy="MlpPolicy", env=env, verbose=1) # Instantiate PPO algorithm
ppo.learn(total_timesteps=100) # Train the PPO algorithm
# ppo.save("trained_ppo_model") # Save the trained model
# ppo.evaluate(env, n_eval_episodes=10) # Evaluate the trained model
except Exception:
print(traceback.format_exc())`
but the outcome on the cmd was exactly the same :/
from carla.
I'm not really sure what to make of this, perhaps someone like @joel-mb from the CARLA team can help you better. There isn't a lot of information in that specific Client.h
file apart from the fact that a client cannot subscribe twice to the same stream. I also found #7295 but there isn't much information in that either. Based on these two, the only thing I can think of is that perhaps your client is somehow listening to a sensor's datastream twice (maybe because you are vectorizing the environment for RL training?)
I doubt this new error is related to your use of VehicleControl
, so one thing you could do is use a debugger (e.g. VSCode's Python Debugger) to see how your code progresses and where the problematic line is. Or you can just put print()
lines along your code and see what gets printed and what doesn't to see which lines get executed and which line throws out the error.
from carla.
Related Issues (20)
- Setup.sh: Implement a work around when apt update not works
- No CarlaUE4.sh file HOT 4
- launch error HOT 2
- How to replay and record from a driving perspective HOT 5
- ShaderCompileWorker directory not found error when launching the Editor HOT 2
- CARLA C++ client example/easy_import_cmake_include HOT 3
- destroying actors from a list HOT 2
- CarlaUnreal repository not found HOT 2
- BuildLibCarla.sh: Building LibCarla "Client.Release" configuration.
- Using the manual_control.py script, pygame displays a black screen HOT 5
- Create OptiX UE5 Plugin
- Import Static object to OptiX Scene
- Import Dynamic Objects to OptiX Scene
- Test Ray tracing capabilities from OptiX
- Add to Spawn Actor Function Attributes Map HOT 3
- Create mechanisim to get post process volume values into camera sensor
- Fix Pedestrians colision/DeathAnim Gen3 HOT 1
- Sensors in CARLA unaffected by weather conditions HOT 1
- How to acquire intensity and angle when using LiDAR? HOT 1
- Carla crash with quality mode low and RenderOffScreen HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carla.