Simulation - lukasholtkamp/b.ob GitHub Wiki
Running the Simulation
To run the simulation on your laptop, follow these steps:
-
Open your terminal and navigate to the
b.ob
folder:cd b.ob/
-
Change
/path/to/your
to your own path. For example:/home/bertrandt/b.ob/src/map2gazebo/models/
Then, execute the following commands:git checkout Simulation-base colcon build export GAZEBO_MODEL_PATH=/home/path/to/your/b.ob/src/map2gazebo/models/ export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/home/path/to/your/b.ob/src/pedsim/pedsim_gazebo_plugin/models export GAZEBO_RESOURCE_PATH=$GAZEBO_RESOURCE_PATH:/home/path/to/your/b.ob/src/pedsim/pedsim_gazebo_plugin/worlds export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/home/path/to/your/b.ob/src/pedsim/pedsim_gazebo_plugin/src source /usr/share/gazebo/setup.sh source install/setup.bash
You can run the simulation in two modes:
With Static Obstacles
ros2 launch bob_simulation launch_sim.launch.py
With Dynamic Obstacles
ros2 launch bob_simulation launch_sim_people.launch.py
Creating URDF Files
The Unified Robotics Description Format (URDF) is an XML specification widely used in both academia and industry to model multibody systems such as robotic arms for assembly lines and animatronic robots for theme parks. URDF is particularly popular among users of the Robotics Operating System (ROS).
How to Create a URDF File for B.Ob
To learn how to create a URDF file for B.Ob, watch the following tutorial video: Creating a rough 3D model of our robot with URDF
Rviz
If you want to view sensor data on Rviz, in a separate terminal run:
rviz2
Displaying topics
Here you can find the different things that can be displayed in rviz: http://wiki.ros.org/rviz/DisplayTypes
Gazebo
Building a World
To build a new world in Gazebo, follow these steps:
1. Open your terminal and type:
gazebo
This will open the Gazebo environment.
2. To add objects and create your own world, go to the "Insert" tab.
3. You can add objects using the symbols where the green circle is located. To change the position, orientation, etc., use the symbols in the red circle.
4. After creating your world, press Ctrl + Shift + S
and save your world with a .world
file extension (e.g., my_world.world
).
5. If you want to respawn B.Ob in your world, move your saved world file to the bob_simulation/worlds/
directory.
6. Edit the launch_sim.launch.py
file in this directory and update the world_filename
variable with the name of your world.
For example:
world_filename = "my_world.world"
7. Then run
colcon build
source install/setup.bash
ros2 launch bob_simulation launch_sim.launch.py
to respawn B.ob in your world
-
Note: If you want to edit your world make sure you remove bob from gazebo.
Ped Sim
TBD
Building a scenario
TBD