rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Changing Names of Variables Named "type", "orientation", and "angle" #37

Closed mchlswyr closed 3 years ago

mchlswyr commented 3 years ago

Problem

Changes

Comments

  1. The member variable named type in the classes Actor and TrafficLight was not replaced because references to that variable in instances of those classes are <name_of_instance_of_class>.type (e.g., self.type, vehicle.type, pedestrian.type, etc.), so "shadowing" isn't relied on in this case
  2. The member variable named type in the class MStopConfig should also be replaced, but would require updating all of the .btree files (e.g., scenarios/trees/drive.btree)
  3. The parameter named angle in speed_to_vel() in Utils.py wasn't changed to yaw since speed_to_vel() could be used with other angles (e.g., with pitch, if this is ever going to be used in some future version of GeoScenario)
  4. The angle attribute in the Trajectory Node preset was changed to yaw in case other angles (such as pitch when changing altitude, e.g.) are used to describe the trajectory in future versions of GeoScenario
  5. The variables named outOrientation in SimVehicle.cpp and SimVehicle.h weren't renamed because they were assigned an FRotator(), which consists of pitch, yaw, and roll

Questions

  1. Should we replace MStopConfig.type with MStopConfig.when? The different types are "now", "position in frenet frame", "goal", and "stop line". It could be read as "stop when the goal is reached", e.g. We could then change the Type class to When. Or maybe something other than type and when?

Testing

cd ~/anm_unreal_sim/submodules/geoscenarioserver
bash scripts/install_dependencies.bash

source "catkin_ws/install/opt/ros/lanelet2/setup.bash"

kill_python38() { killall python3.8 }

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

- Only `README.md` should fail

### Test 2
- Package the simulator, and switch to it:
```sh
bash ../base_unreal_project/package.sh
cd ~/anm_unreal_test_suite
bash scripts/wise_sim_switch.bash dev

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

cleanup_and_exit() { killall python3.8 killall roslaunch

# Cleanup Shared Memory
ipcrm -M 0x0001e240 # 123456
ipcrm -M 0x00051877 # 333943

# Cleanup Semaphores
ipcrm -S 0x000549c5 # 346565
ipcrm -S 0x000e3e39 # 933433

exit 0

}

keyboard_int() { echo "" echo "Press ENTER to exit." }

trap keyboard_int SIGINT

source "${GSS}/catkin_ws/install/opt/ros/lanelet2/setup.bash" --extend python3.8 "${GSS}/GSServer.py" -s 'scenarios/test_scenarios/gs_ringroad_stress_loop.osm' & bash "${SIM}/scripts/launch.bash" 'ring_road_ccw' > simlog.log &

read -p "Press ENTER to exit." cleanup_and_exit


- You should see the gss vehicles after driving for about a minute
rodrigoqueiroz commented 3 years ago

Good with the changes. We can keep the MStopConfig "type" for now.