Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] TraCI Invalid departLane definition error

Hi!

I'm currently on SUMO version 1.1.0, but the same error occurs for someone on 1.2.0 too. The error is that traci throws an error saying that the departLane for a vehicle is flawed (and then I get another error):

(pid=6012) Error: Answered with error to command 0xc4: Invalid departLane definition for vehicle 'idm_0';
(pid=6012)  must be one of ("random", "free", "allowed", "best", "first", or an int>=0)
(pid=6012) Error: Answered with error to command 0xc4: Vehicle 'idm_0' is not known
2019-11-30 15:38:19,812 ERROR trial_runner.py:550 -- Error processing event.
Traceback (most recent call last):
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/tune/trial_runner.py", line 498, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/tune/ray_trial_executor.py", line 342, in fetch_result
    result = ray.get(trial_future[0])
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/worker.py", line 2247, in get
    raise value
ray.exceptions.RayTaskError: ray_PPO:train() (pid=6012, host=thankyou-always)
  File "/home/thankyou-always/Desktop/flow/flow/envs/base.py", line 487, in reset
    speed=speed)
  File "/home/thankyou-always/Desktop/flow/flow/core/kernel/vehicle/traci.py", line 1028, in add
    departSpeed=str(speed))
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/traci/_vehicle.py", line 1428, in add
    self._connection._sendExact()
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 106, in _sendExact
    raise TraCIException(err, prefix[1], _RESULTS[prefix[2]])
traci.exceptions.TraCIException: Invalid departLane definition for vehicle 'idm_0';
 must be one of ("random", "free", "allowed", "best", "first", or an int>=0)

During handling of the above exception, another exception occurred:

ray_PPO:train() (pid=6012, host=thankyou-always)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 372, in train
    raise e
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 358, in train
    result = Trainable.train(self)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/tune/trainable.py", line 171, in train
    result = self._train()
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 126, in _train
    fetches = self.optimizer.step()
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/optimizers/multi_gpu_optimizer.py", line 151, in step
    samples.append(self.workers.local_worker().sample())
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/evaluation/rollout_worker.py", line 453, in sample
    batches = [self.input_reader.next()]
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/evaluation/sampler.py", line 56, in next
    batches = [self.get_data()]
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/evaluation/sampler.py", line 97, in get_data
    item = next(self.rollout_provider)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/evaluation/sampler.py", line 313, in _env_runner
    soft_horizon)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/evaluation/sampler.py", line 473, in _process_observations
    resetted_obs = base_env.try_reset(env_id)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/env/base_env.py", line 336, in try_reset
    return {_DUMMY_AGENT_ID: self.vector_env.reset_at(env_id)}
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/ray/rllib/env/vector_env.py", line 104, in reset_at
    return self.envs[index].reset()
  File "/home/thankyou-always/Desktop/flow/flow/envs/base.py", line 500, in reset
    self.k.kernel_api.vehicle.remove(veh_id)  # FIXME: hack
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/traci/_vehicle.py", line 1436, in remove
    tc.CMD_SET_VEHICLE_VARIABLE, tc.REMOVE, vehID, reason)
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 143, in _sendByteCmd
    self._sendExact()
  File "/home/thankyou-always/anaconda3/envs/flow/lib/python3.6/site-packages/traci/connection.py", line 106, in _sendExact
    raise TraCIException(err, prefix[1], _RESULTS[prefix[2]])
traci.exceptions.TraCIException: Vehicle 'idm_0' is not known


And so, I print out the actual value for the corresponding departLane:

(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_0
(pid=6012) No error
(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_1
(pid=6012) No error
(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_2
(pid=6012) No error
(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_3
(pid=6012) No error
(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_4

(These print values are for when there's no error. The number to the right of 'lane_index' is the value fed into "departLane" when adding a vehicle via traci vehicle add.)

When the error occurs, I still input the same values.

i.e. printed out:

(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_11
(pid=6012) Error
(pid=6012) lane_index is 0
(pid=6012) veh_id is idm_0

[Error message follows]

Would anyone have a clue to why traci responds differently to the same inputs when I'm adding a vehicle?

Thanks for your time!

Kevin

...

Back to the top