Running the Simulator
Suppose we have implemented the robot controller, running the simulator requires the following steps:
- Start ROS using tmuxinator. Here we run the default navigation stack for example:
cd ~/sim_ws/tmux/sean_navstack
tmuxinator
Note: for more information on
tmux
, checkout the tmux tutorial.
Note: if you experience any errors with the
vosk
package (i.e. the last pane of tmuxinator gives an error) you may not have theros-vosk
package installed. Follow the instructions to install it here if your project needs Vosks's speech-to-text functionality.
- Start Unity, use the Project tab to open scene such as
Assets -> Scenes -> SEAN -> Warehouse
.
- Now that the scene is open, find the Hierarchy tab and click the SEAN object. You'll see the custom editor UI open in the Inspector tab.
- Use the SEAN UI in the inspector tab to choose a method of pedestrian control and the robot task.
Your choice of Pedestrian Control and Robot Task will modify the currently enabled objects in the hierarchy view so that the correct behaviors are enabled when you start the simulation. To change or debug a behavior manually enable the correspond GameObject in
Warehouse -> Environment -> Pedestrian Control
or to change or debug a taskWarehouse -> SEAN -> RobotTasks
. New methods of pedestrian control and robot tasks can be implemented by adding new GameObjects as children of these same GameObjects. New methods will be automatically detected and added to the dropdown menus.
- The choices in these dropdowns correspond to the scenario's pedestrian behavior and robot task which include:
Pedestrian Behaviors:
- Handcrafted Pedestrian Behavior: Start and goal poses for the pedestrians are chosen manually in each environment and are designed to resemble specific social situations.
- Graph-based Pedestrian Behavior: The Behavior Graph is used to specify collective pedestrian behaviors. An annotation is overlaid in the environment that parameterizes pedestrian motion via 2 types of nodes that determine agent behavior.
- Random Pedestrian Behavior: Pedestrian start and goal locations are selected by choosing random points on the navigable plane of the environment.
Robot Tasks:
-
RandomABNav: uniformly samples a start and a goal pose from the navigable plane in the environment.
-
BusyABNav: samples a start and a goal pose nearby the largest cluster of pedestrians. Ground truth pedestrian poses are clustered via k-means.
-
Join Group: a group center is sampled from graph nodes associated with group formations. Then, a point nearby the group center is sampled as the goal location and a further away point is sampled for the start pose.
-
Leave Group: a group center is sampled from graph nodes associated with group formations. Then, a point nearby this center is sampled for the start location and a further away point is sampled for the goal pose.
-
Handcrafted: assigns a start and goal pose specifically chosen by a scenario designer. We implemented 5 handcrafted tasks corresponding to the cross path, down path, joining group, leave group and empty social situations.
-
Hit the
Play
button in the top-center of the Unity window. After a second or two, you should see the robot navigating in the warehouse in theGame
view.
Viewing ROS with Rviz
Once Unity enters play mode and ROS has been started via the appropriate tmuxinator configuration, you should see a map appear in rviz
With the default navigation stack running, set a goal position using the 2D Nav Goal
button in rviz.
The robot should move to the goal position.
Implementing your own Controller
Now that you have understood how to run the ROS default navstack, you can proceed to implementing your own controller.