| RTI SimCreator & SimObserver Support Home |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| Alicia |
Posted: Oct 7 2009, 08:13 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 38 Member No.: 65 Joined: 25-March 09 |
Hello!
I would like to set some of my signals to stay green in a certain direction, can I do that? Thanks, Alicia |
| hstoner |
Posted: Oct 7 2009, 08:29 AM
|
||
|
SimVista Forum Moderator ![]() ![]() ![]() Group: Members Posts: 65 Member No.: 16 Joined: 5-September 06 |
This type of functionality was introduced in the latest version of our product (2.30). That was shipped out the week of September 21, 2009. Some of the command that would be useful to you in this case is setDefaultTime(). There are examples of this in SystemTestScenario_34. (databaes/SystemTestScenario and databases/SystemTestScenarioScripts) For example if you have a proximity sensor just before the intersection you can have the following code in your JavaScript that will force the traffic light to turn Green for the subject vehicle.
|
||
| Alicia |
Posted: Oct 7 2009, 09:11 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 38 Member No.: 65 Joined: 25-March 09 |
thanks!
How does getIntersectionController know which interesection to look at. Is a4 the name of the tile? Or does it always get the info from the nearest intersection? |
| Alicia |
Posted: Nov 2 2009, 10:46 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 38 Member No.: 65 Joined: 25-March 09 |
Hi Heather,
I'm using this exact script, but sometimes it seems to work for me and sometimes it doesn't. What exactly is this command saying to do? "Scenario.Subject.setPhase(PHASE_GREEN, 40);" turn the light green in 40 seconds? hold it green for 40 seconds? I'm assuming for this line if(Scenario.Subject.getDirection() == 0), 0 is the "north" direction? Thanks, |
| RichardRomano |
Posted: Nov 3 2009, 07:27 AM
|
|
Member ![]() ![]() Group: Members Posts: 15 Member No.: 3 Joined: 2-July 04 |
Subject.getIntersectionController returns the intersection that the subject is approaching. Typically you have to be within 50 meters for it to work.
The setPhase(PHASE_GREEN,40) is telling the intersection controller to move to the green phase for the direction the subject is travelling and stay there for 40 seconds. How long it takes to get to the green phase is unfortunately dependent on what phase the controller is currently in. It needs to give a full yellow phase for the direction it is currently green in and then you will get the green phase you are asking for. If the controller happens to be already green in your direction when you ask for the green phase then you will get that phase to continue for another 40 seconds. This means that you might need to take control of the intersection controller a little sooner than you think to make sure it is in the phase that you need. |
| Alicia |
Posted: Nov 3 2009, 10:33 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 38 Member No.: 65 Joined: 25-March 09 |
I think I placed my sensors at the begining of the tile (100 m away), so that's probably my problem. Thanks!
|
![]() |
![]() ![]() ![]() |