GithubHelp home page GithubHelp logo

gazebo_ros_interface's Introduction

Homework 3: Gazebo and ROS Control

ME 495: Embedded Systems in Robotics

Kashish Goyal

Introduction

The package demonstrates the usage of Gazebo simulation tool and its interfacing with ROS.

Part 1: rrbot and ROS interfacing

  1. The Gazebo world - rrbot.world

    The world contains 4 models namely House1, Pickup, Mailbox and Jersey Barrier.

  2. The launch file - rrbot_world.launch

    The launch file will launch the Gazebo simulator with the world file mentiond in the previous text and also spwan rrbot model. This can be seen in the following image.

  3. Viewing the camera image - rqt_image_view

    • To start the rqt_image viewer, we use the following command:
     $ rosrun rqt_image_view rqt_image_view
    

    Make sure the correct topic is selected in the rqt window. It should be /rrbot/camera1/image_raw.

    • The view from the camera is:

    • The plugin responsible for simulating the camera is camera_controller and this can be seen in the file rrbot.gazebo file here.

    • The simulated image is published on /rrbot/camera1/image_raw topic and this is defined in the rrbot.gazebo file inside the plugin tag. This can be seen here.

  4. Launching Rviz along with Gazebo

    • The file, rrbot_rviz.launch launches Rviz with the specific configuration which is descibed in the file rrbot.rviz. Rviz is started with LaserScan and Camera modules.

    • To make the laserscan show up in Rviz, following steps need to be followed:

      • In the file rrbot.gazebo, make the following changes. Replace: <sensor type="gpu_ray" name="head_hokuyo_sensor"> to <sensor type="ray" name="head_hokuyo_sensor"> as shown here, and replace <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so"> to <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">. This can be seen here.
      • Also, set the <visualise> tag to true as here.
    • With a noise setting such that mean is 0.0 and standard deviation is 0.01, following is observed in the Rviz

    • With a noise setting such that mean is 0.0 but standard deviation is 5, following is observedin Rviz

      It can be seen that with high value of standard deviation, it is tough to extract any significant results out of the data which is nothing but a collection of randome dots.

Part 2: ROS control, ROS communication, and custom plugins

  1. Gazebo_ROS_Control

    • By default, the gazebo_ros_control plugin does not provide joint state information to ROS. The YAML file that configures the joint_state_controller/JointStateController to convert model poses to joint_states information is here.
    • To run this configuration, a. Launch the rrbot_world.launch file. b. Launch the rrbot_control.launch file. This file starts the controller and also starts the Rviz node which listens to the robot_state_publisher to move the data in sync with Gazebo.

      The launch file also takes an argument jspub which is by default set to false. To run the Joint_State_publisher, set this to true. Rviz will then listen to `Joint_State_Publisher* and not Gazebo for joint state information.

  2. Swinging the Arm

    To swing the arm we use /gazebo/apply_joint_effort service and call it using a custom python script. The procedure to run this is:

    • Launch the Gazebo world using rrbot_world.launch file if it is not already running.
    • Launch the rrbot_control.launch file.
    • Run the node swing_arm.py. This node uses the /gazebo/apply_joint_effort service and applies torque to joint1 for certian time and then withdraws it. This allows the arm to swing. The motion is not controlled however. The arm can be seen swinging in the Gazebo simulator and Rviz.
  3. RRBot custom plugin

    • To get the plugin running followng are the things to be done:

      • The plugin is to be compiled using catkin_make. The name of the plugin can be reconned from the CMaklists.txt file from this line.
      • Now the rrbot.gazebo file from the rrbot_description package has to be updated to add this plugin. The new file is rrbot_plugin.gazebo and the changes made are here.
    • The new launch file rrbot_world_plugin.launch is the upldated launch file that contains reference to the new rrbot_plugin.gazebo. The file also includes a call to run the rrbot_control.launch file. This elin=minates an additional step.

    • After launching file we inspect the list of topics using :

      $ rostopic list
      

      we see the following additional topic.

      /rrbot_joint_position_control/rrbot_ref_joint_config
      

      Inspecting the topic using the follwing commands, we get the message definition.

      $ rostopic type /rrbot_joint_position_control/rrbot_ref_joint_config |rosmsg show
      float32 j1
      float32 j2
      
  4. Cyclic Trajectory

    To make the end effector follow a cyclic trajectory, we use a node very similar to the previous homework but with few changes. The node will now publish on the /rrbot_joint_position_control/rrbot_ref_joint_config topic with the new message definition. The node can be seen here. To see this running, follow the steps:

    • Launch the circle_swing.launch file. This file already includes the links different nodes needed. It does take the arguments such as time which controls the period of the loop, rviz which controls whether or not to start Rviz , etc. Both the Rviz and the Gazebo are launched from the same file. The arguments for the launch file are here.

Commit Description

Hashtag Description
baa8911 Updated Readme.md
3db140e Added the circle_swing node and launch file
9ce03c6 Adde the plugin
13d90a3 Added the node to swing the arm
436849e Added laser scan screenshots
5afc09c Added the models to world file
0ea8b15 First run of the URDF in RVIZ
9deb319 Added dep to CMakeLists and cleaned up plugin formatting
208e06d Updated the API for Gazebo 7 on Kinetic
cd76198 Just cleaning up whitespace
ee19f63 Merge remote-tracking branch 'origin/starter' into starter
b98eea5 Added README files
c52aad4 Added README files
2b55a61 Just adding some of the template code
6fe8662 β€œroot”

gazebo_ros_interface's People

Contributors

kashugoyal avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.