Usage
You can launch a scenario represented by an SVG or YAML file as follows:
python3 -m namosim.main run tests/scenarios/minimal_stilman_2005.svg
python3 -m namosim.main run tests/scenarios/citi_ing/namo.yaml
Instructions on how to create custom scenarios can be found on the Guides page.
Examples
A set of executable examples demonstrating key features are available in the examples/
folder. They can be run like so:
./examples/3_robots.sh
./examples/with_slam_generated_map.sh
Examples Code Usage
Here is a quick example of using namosim
in Python to load a scenario and compute a plan:
from namosim.navigation.action_result import ActionSuccess
from namosim.world.world import World
world = World.load_from_svg(
"tests/scenarios/minimal_stilman_2005.svg",
)
agent = world.agents['robot_0']
agent.sense(ref_world=world, last_action_result=ActionSuccess(), step_count=0)
think_result = agent.think()
assert think_result.plan is not None
assert len(think_result.plan.paths) == 3
assert think_result.plan.paths[1].is_transfer
This example can be executed with
python3 -m examples.compute_plan
Visualization
By default, namosim
renders the robots and environment in a Tkinter window. More detailed aspects of the operation of namosim
can be visualized in RViz. To do this, first launch RViz with:
rviz2 -d rviz/basic_view.rviz
Then, in a new terminal, launch a scenario:
python3 -m namosim.main run tests/scenarios/minimal_stilman_2005.svg
Both Tkinter and RViz visualization can be disabled by setting the following environment variables. Doing this slightly improves the speed of the planner.
export NAMO_DEACTIVATE_TKINTER="TRUE"
export NAMO_DEACTIVATE_RVIZ="TRUE"