Skip to content

ROS1-package with Gazebo stuff for Pet Mk.IV - One of our home made micro-robots in the Pet-Series.

License

Notifications You must be signed in to change notification settings

Pet-Series/pet_mk_iv_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License MIT ROS version ROS version

README: /pet_mk_iv_simulation/

ROS1 repository in the https://github.com/Pet-Series Git-Organizations.
Containing a Pet-Nk.IV ROS1-package / data for Gazebo & RViz

The following repositoris need to spawn the rebot and run missions scripts.

What is this folder for?

ROS package neccesary to be able to run robot simulation of Pet-Mk.IV, using Gazebo.

This package is only necessary if you are going to launch your robot into a simulated world.

If you only will run the physical robot - Then you do not need this package.

Setup

How do I get set up?

Set up for simuation in Gazebo

  • PC with Ubuntu 20.04
  • ROS1 melodic
  • Install repo:
    ~$ mkdir -p ros_ws/src
    ~$ cd ros_ws/src
    ~/ros_ws/src$ git clone https://github.com/Pet-Series/Pet-Mk-IV.git
    ~/ros_ws/src$ git clone https://github.com/Pet-Series/pet_mk_iv_simulation.git
    ~/ros_ws/src$
    
    ~/ros_ws/src$ cd ..
    ~/ros_ws$ 
    
    ~$ cd ros_ws 
    ~/ros_ws$ catkin_make  (vs. $ catkin build  ??)
    ~/ros_ws$
    
    Note: 'catkin_make' - Alternative instead of 'catkin build'
    Note: 'catkin build' - A more flexible way of buildning ROS1/Noetic packages

Examples

Spawn Gazebo worlds (Play yard #1)

  1. Start Gazebo
  2. Spawn the world(play yard)
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_simulation pet_play_yard-01.launch
    
    Example Gazebo world #1

Spawn Gazebo worlds (Play yard #2)

  1. Start Gazebo
  2. Spawn the world(play yard)
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_simulation pet_play_yard-02.launch
    
    Example Gazebo world #2

Spawn Gazebo worlds (Play yard #3)

  1. Start Gazebo
  2. Spawn the world(play yard)
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_simulation pet_play_yard-03.launch
    
    Example Gazebo world #3

Example: Spawn the robot, and run a mission node, into a existing Gazebo world

Manual step by step

  1. Gazebo alredy started  <- See any step above
    The world(play yard) already spawned  <- See any step above
  2. Spawn the the robot  <- From a new terminal window
  3. Run a simple test mission  <- From a new terminal window
    Avoid wall/obsticle - Stap when passing a line
  • Start a new terminal window

    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_simulation spawn_pet_mk_iv.launch
    
    x
    x
  • Start a new terminal window

    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ rosrun pet_mk_iv_mission_control testrun_01_avoid-wall-line-stop.py
    
    Example of a node/mission script
    Differencies/Equality between the IRL/physical robot and this digital twin.
    + Same behaivour: Avoid wall/obsticle
    + Same behaivour: Stop when running on a line
    - No visiable update for LCD-display
    - No IR-remote control
    - No visible lamp/beacon

Example: Spawn/Launch all at oence, in one step, into Gazebo

All steps at once (All steps in one .launch file)

  1. Start Gazebo
  2. Spawn the world(play yard)
  3. Spawn the the robot
  4. Launch a simple test mission
    Avoid wall/obsticle - Stap when passing a line
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_simulation testrun_01_avoid-wall-line-stop.launch
    
    Example: spawn, launch and run in one step

    Note: To start the simulation in Gazebo -> Press [Play] in Gazebo

Launch RViz

Vizualize in real time all robot sensor data...

  1. When the robot is running in Gazebo
  2. Launch RViz
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ roslaunch pet_mk_iv_description rviz.launch
    
    Example: Pet-Mk.IV realtime vizualization with RViz
    - TF tree
    - All sensors
    - Camera

Launch rqt_graph

Vizualize relevant nodes and topics

  1. When the robot is running in Gazebo
  2. Launch rqt_graph
  • Start a new terminal window
    ~$ cd ros_ws
    ~/ros_ws$ source devel/setup.bash
    ~/ros_ws$ rqt_graph
    
    Example: Pet-Mk.IV realtime vizualization with RViz
    - TF tree
    - All sensors
    - Camera

Who do I talk to?