introduction to jackal in gazebo simulator - ori-systems/work_experience GitHub Wiki

Introduction to Jackal in Gazebo simulator

Launch Gazebo:

roslaunch jackal_gazebo jackal_world.launch config:=front_laser

Demo Move Around

You can move Jackal in three different ways:

  1. Publishing onto the topic /cmd_vel directly.

    This robot needs to publish the Twist message continuously, otherwise it will stop moving. This is normal for safety reasons. The rate will depend on how smooth you want the movement to be. Here is an example of a 1 Hz publish:

    rostopic pub -r 1 /cmd_vel geometry_msgs/Twist "linear:
      x: 0.0
      y: 0.0
      z: 0.0
    angular:
      x: 0.0
      y: 0.0
      z: 1.0"
    

    Be careful when typing this command. Do NOT copy paste, otherwise the format might not be the correct one. This is a quirk of ROS commands. You have to type the command like this:

    rostopic pub -r1 /cmd_vel geometry_msgs/Twist 
    

    And after giving space after "..Twist ", double TAB. This will auto generate the message structure necessary to publish it correctly, based on the geometry_msgs/Twist that you stated.

    If you want to COPY and PASTE the command, you will have to copy and paste in this format:

    rostopic pub -r 1 /cmd_vel geometry_msgs/Twist  '{linear:  {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 1.0}}'
    
  2. Launching the keyboard teleop launch, and move it with the keyboard.

    Execute in a terminal:

    roslaunch jackal_tools start_teleop.launch
    

    Now, you can use the keys indicated in the terminal output in order to move the robot around.

    i 	Move Forward
    , 	Move Backward
    k 	Stop
    l 	Turn left
    j 	Turn Right
    u 	Turn Left and Forward
    o 	Turn Right and Forward
    m 	Turn Left and Backward
    . 	Turn Right and Backward
    q/z     Increase/decrease Speed
    

    Try it!! When you're done, you can Ctrl+C to stop the execution of the program.

  3. Using in RVIZ Interactive Markers to publish in /cmd_vel.

    Execute in a terminal

    roslaunch jackal_tools view_robot.launch
    

    Note: If Interactive markers not showing, run the following command in a terminal:

    roslaunch interactive_marker_twist_server interactive_markers.launch
    

    You should get something like this:

As you can experiment, you have an interactive marker that publishes linear velocity ( red arrows) and angular turn ( blue circle).

Demo Navigation

In this course you will learn how to make Jackal Navigate autonomously among other things. Here you are going to see two examples of navigation: without map and with map.

  1. Navigate without a Map

    To start the navigation without a map launch the following command:

    Execute in a terminal:

    roslaunch jackal_tools start_localmap_navigation.launch
    

    This command will start the navigation with only a localCostmap generated on the fly by the laser readings. This will be used by the planner to plan the best route based on the obtsacles it detects.

    Now here you can select the icon 2D Nav Goal to set a goal for the Jackal. It will try to get there without colliding into obstacles that it detects with its Laser. These obstacles are drawn in the localCostmap that you can see as blue areas that it should not trespass. You should get a result similar to this:

  1. Navigate with a Map

    Now, once Jackal has a map, it will navigate better and further. Execute the following command to start the map navigation and the RVIZ for map navigation.

    Execute in a terminal:

    roslaunch jackal_tools start_map_navigation.launch
    

Warning: If your robot is not where it should be, indicate the position and orientation with the 2D Pose Estimate as shown above. Otherwise Jackal will find much more difficult to localise itself. Now here you can select the icon 2D Nav Goal to set a goal for Jackal.