theomarzaki / TrafficOrchestrator

Traffic Orchestrator for Central unit Processing of autonomous vehicle merging through the use of Reinforcment Learning
MIT License
2 stars 0 forks source link

Test off scope coordinates #47

Closed turbokadi closed 5 years ago

turbokadi commented 5 years ago

Run the TO and test with the V2x. You can also send some OBUs with netcat for example.

Send that like 3 times, it will generate a recommendation that involve the mapper because there is only one OBU. Check in logs

{"type":"notify_add","context":"subscriptions","origin":"gdm","version":"1.2.0","source_uuid":"gdm","destination_uuid":"traffic_orchestrator_1278630710","timestamp":1558017635274,"message":{"subscription_id":1,"ru_description_list":[{"type":"ru_description","context":"general","origin":"self","source_uuid":"gdm","version":"1.2.0","message_id":"OBU15/OBU15/1558017635106","timestamp":1558017635265,"message":{"uuid":"OBU15","its_station_type":"passengerCar","connected":true,"position":{"latitude":486218013,"longitude":22424272},"position_type":"raw_gnss","heading":2993,"speed":793,"acceleration":-17,"yaw_rate":17,"raw_data":false,"size":{"length":0.0,"width":0.0,"height":0.0},"color":"0x000000","existence_probability":100,"accuracy":{"position_semi_major_confidence":0,"position_semi_minor_confidence":0,"position_semi_major_orientation":0,"heading":0,"speed":0,"size":{"length":1.0,"width":1.0,"height":1.0}}},"extra":[{"owner":"orange-labs","status":[]}],"signature":"signature"}]},"message_id":"gdm/1/1558017635274","signature":"signature"}

{"type":"notify_add","context":"subscriptions","origin":"gdm","version":"1.2.0","source_uuid":"gdm","destination_uuid":"traffic_orchestrator_1278630710","timestamp":1558017636275,"message":{"subscription_id":1,"ru_description_list":[{"type":"ru_description","context":"general","origin":"self","source_uuid":"gdm","version":"1.2.0","message_id":"OBU15/OBU15/1558017636108","timestamp":1558017636265,"message":{"uuid":"OBU15","its_station_type":"passengerCar","connected":true,"position":{"latitude":486218261,"longitude":22423550},"position_type":"raw_gnss","heading":2976,"speed":623,"acceleration":8,"yaw_rate":-372,"raw_data":false,"size":{"length":0.0,"width":0.0,"height":0.0},"color":"0x000000","existence_probability":100,"accuracy":{"position_semi_major_confidence":0,"position_semi_minor_confidence":0,"position_semi_major_orientation":0,"heading":0,"speed":0,"size":{"length":1.0,"width":1.0,"height":1.0}}},"extra":[{"owner":"orange-labs","status":[]}],"signature":"signature"}]},"message_id":"gdm/1/1558017636275","signature":"signature"}

{"type":"notify_add","context":"subscriptions","origin":"gdm","version":"1.2.0","source_uuid":"gdm","destination_uuid":"traffic_orchestrator_1278630710","timestamp":1558017636474,"message":{"subscription_id":1,"ru_description_list":[{"type":"ru_description","origin":"self","source_uuid":"gdm","version":"1.2.0","message_id":"10102/10102/1558017636318","timestamp":1558017636465,"message":{"uuid":"10102","its_station_type":"passengerCar","connected":true,"position":{"latitude":486248579,"longitude":22436184},"position_type":"raw_gnss","heading":1671,"speed":77,"acceleration":3,"yaw_rate":-4,"raw_data":false,"size":{"length":45.7,"width":18.94,"height":16.2},"color":"0xFF0000","lane_position":0,"accuracy":{"position_semi_major_confidence":1,"position_semi_minor_confidence":1,"position_semi_major_orientation":1,"heading":0,"speed":1,"acceleration":1,"yaw_rate":1,"size":{"length":1.0,"width":1.0,"height":1.0}}},"signature":"signature"}]},"message_id":"gdm/1/1558017636474","signature":"signature"}
turbokadi commented 5 years ago

@theomarzaki Can you look up what I've made. It's just that I thought the significant was 6 but actually it's 7 digits so my coordinates was always out of the map (index -1 in the vector.at()). I've tested with the v2x and it seems to work.

theomarzaki commented 5 years ago

Other than the changes, looks great to me.

Although since the v2x has been updated, the branch cannot really be tested until I merge the other branch. Which I will do soon. So if Fred is happy with the changes, I would like to merge.

tigroo31 commented 5 years ago

No description provided. :( It could be great to indicate how to test the feature with a minimum of indications (as "use this Injector test Suite and check into the logs that Y). I'm going to review the code, test as I can on my pc and quiclkly check the memory

theomarzaki commented 5 years ago

@tigroo31 , perfect.

I will check the accuracy of the waypoints compared to the hardcoded value and the mapper value or I can just check if the mapper values are close to the hardcoded values. Once the branch is merged however, as the sub request here is still circle.

tigroo31 commented 5 years ago

`__GI_raise 0x00007f8bd26aae97 __GI_abort 0x00007f8bd26ac801

0x00007f8bd309f957 0x00007f8bd30a5ab6 std::terminate() 0x00007f8bd30a5af1 __cxa_throw 0x00007f8bd30a5d24 Mapper::getFakeCarMergingScenario mapper.cpp:324 getClosestFollowingandPreceedingCars CreateTrajectory.cpp:103 RoadUsertoModelInput CreateTrajectory.cpp:212 ManeuverParser CreateTrajectory.cpp:295 computeManeuvers exchange.cpp:299 main exchange.cpp:375 __libc_start_main 0x00007f8bd268db97 _start 0x000055fc4ae26e7a` With the log: `/home/kvmk8371/workspaceC++/TrafficOrchestrator/cmake-build-debug/exchange terminate called after throwing an instance of 'std::runtime_error' what(): [Error] The coordinates are out of map. Signal: SIGABRT (Aborted)` You can't stop the application on a bad coordinate (or for any else reason). It must ignore and continue.
tigroo31 commented 5 years ago

int TIME_VARIANT = 0.035;in to/CreateTrajectory.cpp : Narrowing conversion from 'double' to 'int'

use

const auto TIME_VARIANT{0.035};

tigroo31 commented 5 years ago

auto getClosestFollowingandPreceedingCars(const std::shared_ptr<RoadUser>& merging_car, const std::vector<std::shared_ptr<RoadUser>>& close_by) {

instead of

auto getClosestFollowingandPreceedingCars(const std::shared_ptr<RoadUser> merging_car, std::vector<std::shared_ptr<RoadUser>> close_by) {

theomarzaki commented 5 years ago

The time variant is the stupidest mistake I have made. I fixed it on the other pull request. was actually one of the factors the waypoints weren't working as expected.

theomarzaki commented 5 years ago

for the second function, it is needed, since we already passing the &ref from the for loop. adding && would result in unexpected behaviour

turbokadi commented 5 years ago

@tigroo31 How can I ignore the coordinates since I must respond something. Maybe I can catch the exception lower in the code but I need to give something to the setter. And normally with the future GPS scope it wouldn't be possible anymore. Maybe I can do an optional but after that, what am I gonna give to the setter.

turbokadi commented 5 years ago

@tigroo31 I find no leaks other than libtorch. I use valgrind --leak-check=full --show-leak-kinds=all -v ./exchange

tigroo31 commented 5 years ago

std::optional

Le 17 mai 2019 à 16:10, Cactus Mamelut notifications@github.com a écrit :

@tigroo31 How can I ignore the coordinates since I must respond something. Maybe I can catch the exception lower in the code but I need to give something to the setter. And normally with the future GPS scope it wouldn't be possible anymore.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

turbokadi commented 5 years ago

@tigroo31 Yeah but we need to have coordinates for the car because it's for the RL, you can't just say your equal to nullopt and Voila. I will be forced to modify all the code from Omar, rather than just drop that request in the GPS frame. Previously the program crash because it attempt to reach a -1 index into a vector without any message, and now it's an intended crash with a more explicit message.