Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Launching the Simulation

gcielniak edited this page Nov 1, 2022 · 14 revisions

Launching the Simulation

  • Simple environment single robot, and fake localisation:

    roslaunch bacchus_gazebo vineyard_demo.launch world_name:=vineyard_small
    

    The parameter is also the default, so can be launched also as

    roslaunch bacchus_gazebo vineyard_demo.launch
    

    The Gazebo simulator might be on pause after launching so you need to press the 'play' button in the bottom toolbar of Gazebo to start the simulation.

  • More complex environment with different plant stages:

    roslaunch bacchus_gazebo vineyard_demo.launch world_name:=<WORLD>
    

    with <WORLD> being one of the following:

    • vineyard_small
    • vineyard_small_s0_coarse
    • vineyard_small_s1_coarse
    • vineyard_small_s2_coarse
    • vineyard_small_s3_coarse
    • vineyard_small_s4_coarse
    • vineyard_stage0
    • vineyard_stage0_heightmap
    • vineyard_stage0_small
    • vineyard_stage1
    • vineyard_stage2
    • vineyard_stage3
    • vineyard_stage4
    • vineyard_stage4_small
  • If you intend to run a real localisation system (e.g. amcl) based on maps then set fake_localisation:=false.

  • If you simulation is too slow, you can run the simulation without the Simulation GUI (which is what slows it down a lot), by adding the parameter gui:=false.

Additional information about the launch file (for the interested ones among you)

  1. Consult the roslaunch website (and maybe the tutorial linked from there) to better understand roslaunch files (note: they are used to define the orchestration of a bigger ROS system): http://wiki.ros.org/roslaunch
  2. open https://github.com/LCAS/bacchus_lcas/blob/teaching/bacchus_gazebo/launch/vineyard_demo.launch and https://github.com/LCAS/bacchus_lcas/blob/teaching/bacchus_gazebo/launch/thorvald.launch and find out when and where thorvald.launch is included from vineyard_demo.launch
  3. run roslaunch --nodes bacchus_gazebo vineyard_demo.launch and roslaunch --files bacchus_gazebo vineyard_demo.launch. What is shown on your screen?
  4. run roslaunch --ros-args bacchus_gazebo vineyard_demo.launch, look at the argument world_name which you can use to tell the roslaunch command to start with a different simulation world. You can see all the worlds that exist by running rosls bacchus_gazebo/worlds/. Then you can set the world_name argument, e.g. to something like vineyard_small_s4_coarse (note that the .world should be omitted), i.e. roslaunch bacchus_gazebo vineyard_demo.launch world_name:=vineyard_small_s4_coarse (note the :=)

You can also use an RQT plugin called rqt_launchtree and use the Graphical User Interface (GUI) to introspect your launch file configurations (i.e. step 3 from the above)

Clone this wiki locally