rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Issues in the Table on the Dashboard #43

Closed mchlswyr closed 3 years ago

mchlswyr commented 3 years ago

Changes

  1. The sv variable in the first for loop in write_traffic_state() (in TrafficSim.py) was being assigned vehicle.state.get_state_vector() + vehicle.state.get_frenet_state_vector(), but get_state_vector()'s return value already contains the value returned by get_frenet_state_vector()
    • The extra call, vehicle.state.get_frenet_state_vector(), was removed
    • The above change means that len(sv) is now 13
  2. Since len(sv) is 13, then, in read_traffic_state(), it should be state_vector = traffic_state_sharr[ i+3 : i+16 ] (instead of i+17, or i+18)
  3. Also, in set_state_vector() (in Actor.py), arr[0] to arr[2], arr[3] to arr[6], ..., arr[9] to arr[11] were all set, so it should be arr[12], not arr[13]
    • There are only 13 (indices 0 to 12) items in arr
    • Changes 1. to 3. fixed the issue where the yaw being displayed in the table on the dashboard was incorrect
  4. The tree view was hidden in tab in dash/Dashboard.py
    • This allowed the extra id column to be removed
    • The columns in the table were resized because the extra column was removed

Testing

Test 1

GSS="${HOME}/anm_unreal_sim/submodules/geoscenarioserver"

test_scenarios=$(find "${GSS}/scenarios/test_scenarios" -name ".osm") pedestrian_scenarios=$(find "${GSS}/scenarios/pedestrian_scenarios" -name ".osm") scenarios="$test_scenarios $pedestrian_scenarios"

source "${GSS}/catkin_ws/install/opt/ros/lanelet2/setup.bash" --extend

kill_python38() { killall python3.8 }

for scenario in $scenarios; do read -p "Press ENTER to run ${scenario}:" trap kill_python38 SIGINT python3.8 GSServer.py -s $scenario trap - SIGINT done


- All of the scenarios should run
- There should only be one "id" column
- Select a vehicle in the table
- The yaw (which is relative to the positive vertical axis; 0 to 180 cw; 0 to -180 ccw) displayed for that vehicle should seem reasonable  when compared with the direction of the arrow for that vehicle in the cartesian frame
mchlswyr commented 3 years ago

Are we wrapping yaw between -180..180?

Yes, Python's atan2 function outputs in that range.

mantkiew commented 3 years ago

Is it correct that when the yaw arrow points up (North) the value is 0? Shouldn't we have 0 yaw pointing right (at East)?

mchlswyr commented 3 years ago

Is it correct that when the yaw arrow points up (North) the value is 0? Shouldn't we have 0 yaw pointing right (at East)?

Yes, that is correct. We could, but I'm not sure if Rodrigo relies on the current setup. There is even a yaw -= 90 in GSClient.cpp to account for this.

mantkiew commented 3 years ago

Wait, so in GeoScenario .osm file, when you set a vehicle with yaw=0 it points right but in the dash it'll still point right or north?

mchlswyr commented 3 years ago

Wait, so in GeoScenario .osm file, when you set a vehicle with yaw=0 it points right but in the dash it'll still point right or north?

Oh, I haven't checked that. With the SDV vehicles (the ones that use btrees), their yaw is calculated from their velocity. Initially it is 0, but then it is updated after the first tick.

I don't think GSS even checks the yaw tag for vehicles: SDVs calculate their yaw, EVs (external vehicles) get their yaw from the client, and TVs (trajectory following vehicles) get their yaw from the trajectory nodes.

mantkiew commented 3 years ago

It all depends how the map display is oriented in dash. If it's East points top of screen, then we're fine. However, I'd prefer to have it North points to top and East points to the right.