# Flatsim

flatsim stands for flatworld simulation and is a small simulation application which allows you to run almost the full Isaac navigation stack. The flatsim application simulates a laser range scanner by casting rays in a given occupancy grid map. This kind of simulation is extremely fast compared to a more costly 3D ray scan in a full 3D environment. It is thus a quick and highly performant way to test the navigation stack.

The flatsim application can not provide the same accuracy as a full 3D based simulation inside the actual scenario, especially in terms of accurate simulation of reflections or transparent objects.

flatsim uses the set of nodes from the navigation stack and adds two new nodes:

• DifferentialBaseSimulator: Runs a basic differential base drive model to move the robot around based on the commands sent from the navigation stack. This provides the ground truth pose of the robot for range scan simulation. It also provides wheel odometry which is used as another input by the navigation stack.

• RangeScanSimulator: Computes a simulated flat range scan based on the current position of the robot and the desired map.

## Running the Flatsim Application

1. Start flatsim from inside the Isaac source tree with the following command:

Copy
Copied!

bob@desktop:~/isaac$bazel run //packages/flatsim/apps:flatsim  2. Load the Sight web interface at http://localhost:3000 in a web browser. The flatsim application starts by default in random walk mode. In this mode, a dot, representing the robot, navigates to a random target on the map. When the robot reaches the target, a new target is determined and the robot moves towards that target. ## Using Interactive Markers in Flatsim As a first experiment with flatsim, perform the following steps to add an interactive marker to the map. You can click and drag this marker to different locations on the map. When you do, the robot changes course to move to the new location of the marker. 1. If it is not already running, start flatsim with the following command: Copy Copied!  bob@desktop:~/isaac$ bazel run //packages/flatsim/apps:flatsim


2. Load the Sight web interface at http://localhost:3000 in a web browser. The robot dot begins to navigate to the first random target.

3. In the configuration section on the right side of the Sight web interface, in “goals.goal_behavior”, change the desired behavior from “random” to “pose”. The robot stops moving because you have changed its behavior but you have not yet added the interactive marker that you will configure as a goal for the new behavior.

4. Right-click in the “flatsim - Map View” window and choose Settings.

5. In Settings, click the Select marker dropdown menu and choose “pose_as_goal”.