ms-van3t-devs / ms-van3t

A multi-stack, ETSI compliant, V2X framework for ns-3.
GNU General Public License v2.0
103 stars 34 forks source link

Error by building #13

Closed melihyazgan closed 6 months ago

melihyazgan commented 8 months ago

Greetings,

i am getting following errors: fatal error: ns3/v2xEmulator.h: No such file or directory 24 | #include "ns3/v2xEmulator.h" ns3/simpleCAMSender-gps-tc.h: No such file or directory 3 | #include "ns3/simpleCAMSender-gps-tc.h" ns3/areaSpeedAdvisorServer80211p.h: No such file or directory 24 | #include "ns3/areaSpeedAdvisorServer80211p.h"

I followed the readme. OpenCda and Carla are working but I can't build ms-van3t. Do you guys have an idea maybe?

Regards, Melih

melihyazgan commented 8 months ago

Another question regarding the process after build Is there any example config file? Because the examples expect the "ms_van3t_example.yaml" file but it is not provided

carlosrisma commented 8 months ago

Hello Melih,

there are 2 example config files, the one you mention should be found in path/to/OpenCDA_HOME/opencda/scenario_testing/config_yaml/ms_van3t_example.yaml (https://github.com/carlosrisma/OpenCDA/blob/main/opencda/scenario_testing/config_yaml/ms_van3t_example.yaml) Let me know if you manage to make it work.

Cheers, Carlos

melihyazgan commented 8 months ago

Hi Carlos, thank you, somehow it was broken by me. I am getting the following error after I switched the carla and tried to build. The first build was successful

Screenshot from 2024-02-05 16-45-39

Cheers, Melih

carlosrisma commented 7 months ago

Hi Melih,

the error you were getting was due to an incompatibility of the ms-van3t-CARLA CMakeLists.txt. Now we have updated the CARLA extension auxiliary files and the error should disappear. You should pull from the last commit and run the _./switchms-van3t-CARLA.sh script twice.

Cheers, Carlos

melihyazgan commented 7 months ago

Hi Carlos, Thank you for your help and updates. I removed the old repo and started from scratch. But this time I am getting following error, which I couldn't understand the issue. OpenCDA is not working on my workstation. I tried here a simple scenario from OpenCDA which is written in Docu. Maybe you have encountered something like this.

OpenCDA Version: 0.1.3 load opendrive map '2lane_freeway_simplified.xodr'. Creating platoons/ Traceback (most recent call last): File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/scenario_testing/platoon_stability_2lanefree_carla.py", line 40, in run_scenario platoon_list = scenario_manager.create_platoon_manager() File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/scenario_testing/utils/sim_api.py", line 536, in create_platoon_manager data_dumping=data_dump) File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/customize/core/common/vehicle_manager.py", line 101, in init data_dumping) File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/core/common/vehicle_manager.py", line 110, in init data_dumping) File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/core/sensing/perception/perception_manager.py", line 385, in init 'If you activate the perception module, ' SystemExit: If you activate the perception module, then apply_ml must be set to true inthe argument parser to load the detection DL model.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "opencda.py", line 78, in main() File "opencda.py", line 73, in main scenario_runner(opt, scene_dict) File "/home/nj644/dev/v2x-sim/OpenCDA/opencda/scenario_testing/platoon_stability_2lanefree_carla.py", line 161, in run_scenario eval_manager.evaluate() UnboundLocalError: local variable 'eval_manager' referenced before assignment WARNING: sensor object went out of the scope but the sensor is still alive in the simulation: Actor 26 (sensor.other.gnss) WARNING: sensor object went out of the scope but the sensor is still alive in the simulation: Actor 27 (sensor.other.imu) Aborted (core dumped)

Cheers, Melih

valerionori commented 7 months ago

Hi,

maybe I can help you since I faced a similar issue.

Basically the error tells you that you should use the --apply_mlargument, meaning using PyTorch to achieve the perception of other vehicles.

In that specific example this should not happen, however it occurs because the developers probably modified the code later on.

Go to OpenCDA/opencda/scenario_testing/config_yaml. You will see the .yaml files of every example. In the .yaml file of your specific example, you may note the lines:

perception
  activate: true

This means that the script will use PyTorch for detecting vehicles, thus forcing you to add the above mentioned attribute. Set activate: false to retrieve vehicle position by the server and the error should disappear.

Moreover, note that the .yaml configuration are a merge between the .yaml file of your example and the default.yaml file. So, when some attribute is not mentioned you should look at default.yaml to see how it is set.

melihyazgan commented 7 months ago

Hi Valeri, thank you for your help. I noticed that after I tried ml examples given in OpenCDA Documentation. The ml scenarios are working but the others like platoon_stability_2lanefree_carla still not. I did add the activate attribute and assigned it as false. I am getting another error regarding initial positions. python opencda.py -t platoon_joining_2lanefree_carla -v 0.9.12 OpenCDA Version: 0.1.3 load opendrive map '2lane_freeway_simplified.xodr'. Creating platoons/ Traceback (most recent call last): File "/home/nj644/dev/v2x-sim/ms-van3t/ns-3-dev/OpenCDA/opencda/scenario_testing/platoon_joining_2lanefree_carla.py", line 42, in run_scenario data_dump=False) File "/home/nj644/dev/v2x-sim/ms-van3t/ns-3-dev/OpenCDA/opencda/scenario_testing/utils/sim_api.py", line 536, in create_platoon_manager data_dumping=data_dump) File "/home/nj644/dev/v2x-sim/ms-van3t/ns-3-dev/OpenCDA/opencda/customize/core/common/vehicle_manager.py", line 147, in init if config_yaml['v2x']['platoon_init_pos'] == 1: File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 375, in getitem self._format_and_raise(key=key, value=None, cause=e) File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/base.py", line 237, in _format_and_raise type_override=type_override, File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/_utils.py", line 899, in format_and_raise _raise(ex, cause) File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/_utils.py", line 797, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 369, in getitem return self._get_impl(key=key, default_value=_DEFAULTMARKER) File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 443, in _get_impl key=key, throw_on_missing_key=True, validate_key=validate_key File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/basecontainer.py", line 78, in _get_child throw_on_missing_key=throw_on_missing_key, File "/home/nj644/dev/anaconda3/envs/msvan3t_carla/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 480, in _get_node raise ConfigKeyError(f"Missing key {key!s}") omegaconf.errors.ConfigKeyError: Missing key platoon_init_pos full_key: vehicle_base.v2x.platoon_init_pos object_type=dict

valerionori commented 7 months ago

I am aware of that error too and actually I do not know how to solve it.

I tried to install the standard OpenCDA (not the fork created for ms_van3t) and platoon examples work as well.

Maybe the error could be due to omegaconf version, but I am not sure. You may try to install omegaconf 2.3.0 (pip install omegaconf==2.3.0), but I don't know actually if it will mess up anything and solve the error.

I will try in these days to found a correct solution.

melihyazgan commented 7 months ago

Hi Valeri,

I tried omegaconf==2.3.0 and some other library changes too. But I still have the same problem. How about you?

Cheers, Melih

valerionori commented 6 months ago

Hi,

Unfortunately I put aside the CARLA integration at the moment. Right now I'm focusing on introducing Redundancy Mitigation Techniques for the Cooperative Perception Service (relying on SUMO instead of CARLA).

Best regards,

Valerio

carlosrisma commented 6 months ago

Hi all, apologies for the delay in the reply. About the platoon_stability_2lanefree_carla example for OpenCDA scenarios, the issue is due to an incompatibility between the ms-van3t fork and the base OpenCDA framework. We are currently working on adding a Platooning facilities layer protocol implementation for ms-van3t, to then support platooning scenarios in co-simulation. For now, the only scenario that has been fully tested for co-simulation is indeed the ms_van3t_example and the others should be considered as leftovers that we will now delete from the repository to avoid misunderstandings.

Best regards, Carlos

melihyazgan commented 6 months ago

Hi Carlos, What about the problem below that we face. Douy you have any idea about it? I do have a GRPC_CHANNEL_CONNECTING in WHILE -> 1 I do have a GRPC_CHANNEL_READY in WHILE -> 2 Command 'build/src/automotive/examples/ns3-dev-v2v-carla-nrv2x-optimized' died with <Signals.SIGSEGV: 11>.

Regards, Melih

carlosrisma commented 6 months ago

About that issue, I would need further information to replicate the error. Normally, a SIGSEGV error when running in optimized mode is due to an uninitialized variable but is very difficult to spot without some more hints. If possible I would run the example within an IDE (e.g QtCreator) using the debugger, being in optimized it will give a warning because it won't be able to show you exactly which part of the code the issue is but at least it will allow you to know in which file the problem is originated. Let me know if you manage to understand where the problem is happening. Depending on the reason of the problem, you should be able to run the code in debug mode to get started.

Best regards, Carlos

melihyazgan commented 6 months ago

So I started from scratch today and got the following error. I configured with following command: ./ns3 configure --enable-examples --enable-tests --disable-python

assert failed. cond="m_namemap.count (name) == 0", msg="Trying to allocate twice the same uid: ns3::RssiTag", file=/home/nj644/dev/v2x-sim/ms-van3t/ns-3-dev/src/core/model/type-id.cc, line=387
terminate called without an active exception
Command 'build/src/automotive/examples/ns3-dev-v2v-carla-80211p-default' died with <Signals.SIGABRT: 6>.

I changed the configuration to build with optimized and then debugged with gdb. I can give you the backtrace(below).

Thread 1 "ns3-dev-v2v-car" received signal SIGSEGV, Segmentation fault.
0x00005555555fa99c in ns3::Ptr<ns3::OpenCDAClient>::~Ptr() ()
(gdb) bt
#0  0x00005555555fa99c in ns3::Ptr<ns3::OpenCDAClient>::~Ptr() ()
#1  0x00007ffff7cc727f in ns3::VDPOpenCDA::VDPOpenCDA() [clone .cold] () at /home/nj644/dev/v2x-sim/ms-van3t/ns-3-dev/build/lib/libns3-dev-automotive-optimized.so
#2  0x00005555559d0570 in  ()
#3  0x00005555559d1540 in  ()
#4  0x00005555559d0720 in  ()
#5  0x00005555557843e0 in  ()
#6  0xbf557720195f0000 in  ()
#7  0x00000004000000b1 in  ()
#8  0xbf528e664bdea555 in  ()
#9  0x3ff7cbef60000000 in  ()
#10 0x0000000000000000 in  ()

and I have the carla_data_csv files and I can see the beginning of the simulation.

Regards, Melih

carlosrisma commented 6 months ago

Hi Melih,

thank you very much for the detailed bug report. With the debug trace, I was able to spot the issue and it should be solved with the latest commit. Thanks a lot!

Carlos

melihyazgan commented 6 months ago

Hi Carlos, thank you! The examples are working right now.

Melih