deepak.tripathi Posted September 23, 2014 Posted September 23, 2014 Hi, We are facing a issue when we are changing the Driving Sim from Left Hand Drive to Right Hand Drive. For achieving this we have interchanged the mask value of right and left in driving_const.h Roads are working fine but when AI is navigating through junction, They are jumping from the path. Is it a right way to achieve Or we have to change anything other than that. Thanks
silent Posted September 23, 2014 Posted September 23, 2014 Hello! Changing Right Hand Drive to Left Hand Drive is not such easy operation. All constans are hardcoded to the Right Hand Drive and it is not possible to easy switching between these two modes. Here the instructions, that will allow you to change drive direction (however, it can be too complicated and will require a lot of debugging): First of all, revert all masks changes in driving_const.h. This file must remain untouched; In junction.h: in Junction::Entry class you need to modify the rules of junction traffic entry / leave (line 192); in onInit() function it is neccesery to define rules of cars movement (for example, it is not possible to do right turn from the left line and etc.); driver.h: In getPriority() function you need to redefine cars priority inside junctions; searchRoad() / updateRoad() functions also should be modified to return correct road for LHD; current_line variable inside onUpdate() function should be calculated accordingly; Traffic lights (traffic_light, traffic_light_ryg.h, traffic_light_ryggl.h): isPossibleMove() / isPossibleStop() functions should return correct values (in city traffic demo they are used to control advance left arrow); driver_ai.h: current_line variable inside onUpdate() function should be calculated accordingly; Unfortunately, there is no easier way to modify drive direction. Sorry for the inconvenience caused. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
deepak.tripathi Posted September 24, 2014 Author Posted September 24, 2014 Thanks Silent, for driving us into the right direction. We will check all these changes and approach you again in case we get stuck some where. regards
Recommended Posts