There is also some inconsistency when it comes to describing "the angle that an actor (vehicle, pedestrian, etc.) is facing"
In some places the word "orientation" is used, in others "angle" is used, and in others "yaw" is used
Changes
Variables named type containing Actor.type were replaced with a_type
Variables named type containing Vehicle.type were replaced with v_type
Variables named type containing Pedestrian.type were replaced with p_type
Variables named type containing TrafficLight.type were replaced with tl_type
Variables named tl_type containing tnode.tags['type'] were replaced with tltype (kind of like btype)
Variables named angle and start_angle were replaced with yaw and start_yaw (with one exception mentioned in the third comment in Comments)
The tag named angle (used in the nodes that make up a trajectory) in some scenarios under scenarios/eval_scenarios was replaced with yaw (see the fourth comment in Comments)
Variables named orientation were replaced with yaw (with one exception mentioned in the fifth comment in Comments)
The EgoStart, Vehicle, Pedestrian, and Trajectory Node presets all had an attribute named orientation, which was changed to yaw (see the fourth comment in Comments)
Comments
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
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)
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)
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
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
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
In SimConfig.py, set WRITE_TRAJECTORIES = False and CLIENT_SHM = True
Test 1
Test that all of scenarios/test_scenarios still run with following script:
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
Problem
type
in the Python scripts rely on "shadowing" the Python built-in class namedtype
, and we don't want to have to rely on thisChanges
type
containingActor.type
were replaced witha_type
type
containingVehicle.type
were replaced withv_type
type
containingPedestrian.type
were replaced withp_type
type
containingTrafficLight.type
were replaced withtl_type
tl_type
containingtnode.tags['type']
were replaced withtltype
(kind of likebtype
)angle
andstart_angle
were replaced withyaw
andstart_yaw
(with one exception mentioned in the third comment in Comments)angle
(used in the nodes that make up a trajectory) in some scenarios underscenarios/eval_scenarios
was replaced withyaw
(see the fourth comment in Comments)orientation
were replaced withyaw
(with one exception mentioned in the fifth comment in Comments)EgoStart
,Vehicle
,Pedestrian
, andTrajectory Node
presets all had an attribute namedorientation
, which was changed toyaw
(see the fourth comment in Comments)Comments
type
in the classesActor
andTrafficLight
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 casetype
in the classMStopConfig
should also be replaced, but would require updating all of the.btree
files (e.g.,scenarios/trees/drive.btree
)angle
inspeed_to_vel()
inUtils.py
wasn't changed toyaw
sincespeed_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)angle
attribute in theTrajectory Node
preset was changed toyaw
in case other angles (such as pitch when changing altitude, e.g.) are used to describe the trajectory in future versions of GeoScenariooutOrientation
inSimVehicle.cpp
andSimVehicle.h
weren't renamed because they were assigned anFRotator()
, which consists of pitch, yaw, and rollQuestions
MStopConfig.type
withMStopConfig.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 theType
class toWhen
. Or maybe something other thantype
andwhen
?Testing
SimConfig.py
, setWRITE_TRAJECTORIES = False
andCLIENT_SHM = True
Test 1
scenarios/test_scenarios
still run with following script: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
GSS="${HOME}/anm_unreal_sim/submodules/geoscenarioserver" SIM="${HOME}/anm_unreal_sim/submodules/anm_sim_platform"
cleanup_and_exit() { killall python3.8 killall roslaunch
}
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