Giter VIP home page Giter VIP logo

robot_hw_sim_latency's Introduction

robot_hw_sim_latency

Custom gazebo_ros_control simulation plugin that can add latency to communication between ros_control and gazebo

Description

robot_hw_sim_latency

Modification of the default_robot_hw_sim plugin to allow loading custom plugins that can add latency between ros_control and gazebo.

latency_plugin_simple_queue

Simple example latency plugin using queues

Installation

I assume a catkin workspace is already set up, and gazebo_ros_pkgs is installed.

  1. Copy the two folders(robot_hw_sim_latency, latency_plugin_simple_queue) to your workspace
  2. Run catkin_make

Usage

  1. To configure gazebo_ros_control to load robot_hw_sim_latency plugin instead of the default, modify your robot's urdf:

Example: If using UR robots, change https://github.com/ros-industrial/universal_robot/blob/kinetic-devel/ur_description/urdf/common.gazebo.xacro

 <gazebo>
   <plugin name="ros_control" filename="libgazebo_ros_control.so">
     <!--robotNamespace>/</robotNamespace-->
     <robotSimType>robot_hw_sim_latency/RobotHWSimLatency</robotSimType>
     <!--robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType-->
   </plugin>
 </gazebo>
  1. To configure robot_hw_sim_latency to load a custom latency plugin (like latency_plugin_simple_queue) instead of the default, set the /robot_hw_sim_latency/latency_plugin parameter on the Parameter Server.

Example using roslaunch:

  <rosparam param="/robot_hw_sim_latency/latency_plugin">latency_plugin_simple_queue/SimpleQueueLatencyPlugin</rosparam>
  1. To configure the length of queue in latency_plugin_simple_queue, set the /latency_plugin_simple_queue/queue_length parameter on the Parameter Server.

Example using roslaunch:

  <rosparam param="/latency_plugin_simple_queue/queue_length">10</rosparam>

Detailed working mechanism of the system

Working mechanism of the system

The working mechanism of the system is the following:

  1. The gazebo_ros_control update function fires
  2. it calls the readSim function; the call is executed in the RobotHWSimLatency plugin which implements the readSim function
  3. the states are read from the gazebo internals
  4. the delayStates function is called in the Simple queue latency plugin that saves the state messages in a buffer
  5. the previously stored and now delayed states are returned from the Simple queue latency plugin to the RobotHWSimLatency plugin
  6. readSim writes the joint_states to the JointStateInterface of the Harware Resource Interface Layer
  7. gazebo_ros_control calls the update function of the controler_manager
  8. the joint_trajectory_controller in the controller manager executes the calculation of the PID-controllers
  9. the joint_trajectory_controller writes the calculated velocity commands to the VelocityInterface of the Hardware Resource Interface Layer
  10. the gazebo_ros_control calls the writeSim function which is implemented in the RobotHWSimLatency plugin
  11. the writeSim function reads the joint commands from the VelocityInterface of the Hardware Resource Interface Layer
  12. the writeSim function calls the delayCommands function of the Simple queue latency plugin
  13. the previously stored and now delayed commands are returned from the Simple queue latency plugin to the RobotHWSimLatency plugin
  14. the writeSim function writes the joint commands to the gazebo internals
  15. Gazebo calculate the internal states of the simulation loop
  16. a new simulation loop is started by calling the update function of the gazebo_ros_control plugin

How to cite?

@article{gazebopluginconf,
author = {G. Szabo and S. Racz and J. Peto and R. R. Aschoff},
title = {On The Effects of The Variations In Network Characteristics In Cyber Physical Systems},
journal = {In Proc., 31st European Simulation and Modelling Conference},
year = {2017},
month = {Oct.}
location = {Lisbon, Portugal}
}

Expected output

Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings Same trajectories with various latency settings

robot_hw_sim_latency's People

Contributors

nano-meter avatar szgezu avatar

Stargazers

Marcell Balogh avatar Srikrishna avatar OUROBOTICS avatar Michael avatar Rick Staa avatar Silvio Traversaro avatar G.A. vd. Hoorn avatar Rinat Nazarov avatar  avatar Jason Dekarske avatar  avatar Toru Hishinuma avatar yksk avatar  avatar Antoine Hoarau avatar

Watchers

James Cloos avatar Silvio Traversaro avatar Rafael Roque Aschoff avatar  avatar JamieWong avatar OUROBOTICS avatar  avatar

robot_hw_sim_latency's Issues

Failed to create robot simulation interface loader

We tried using this plugin to add a communication latency between Gazebo and ros-control, but we had the following error while trying to run the roslaunch file:

[FATAL] [1522765703.321669592, 0.167000000]: Failed to create robot simulation interface loader: According to the loaded plugin descriptions the class robot_hw_sim_latency/RobotHWSimLatency with base class type gazebo_ros_control::RobotHWSim does not exist. Declared types are gazebo_ros_control/DefaultRobotHWSim

We have modified the urdf and added the rosparams as detailed in the description but it doesn't seem to work.

Any help would be appreciated.

robot_hw_sim_latency does not follow version conventions

When attempting to execute catkin_make with the project robot_hw_sim_latency it produces the following error msg:
Package version "0.1-2.5.11" does not follow version conventions

In order to compile, a bypass is just to change the field version of the file robot_hw_sim_latency/package.xml" to '0.1.2'

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.