Skip to content

i-am-neet/gazebo_ros_model_color

 
 

Repository files navigation

Gazebo ROS Model Color

Build Status Version License

This package contains a gazebo ros plugin which allows the user to modified dynamicly the color of the objects.

Installation

This setup was tested in ROS Kinetic, running on Ubuntu 16.04 LTS.

$ cd ~/catkin_ws/src/
$ git clone https://github.com/verlab/gazebo_ros_model_color.git
$ cd ~/catkin_ws/
$ rosdep install --from-paths src/gazebo_ros_model_color --ignore-src -r -y
$ catkin_make
$ source devel/setup.bash

Usage

This is an example how to use this plugin. Once imported it into a object, ROS should be able to provide a service to change the object color.

    <robot name="color_box">

  <link name="my_color_box">
    <inertial>
      <origin xyz="2 0 0" />
      <mass value="1.0" />
    <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
    </inertial>
    <visual>
      <origin xyz="2 0 1"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="2 0 1"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
    </collision>
  </link>

  <gazebo reference='my_color_box'>
    <visual>
      <plugin name="gazebo_ros_model_color" filename="libgazebo_ros_model_color.so">
        <robotNamespace>/</robotNamespace> <!-- Robot namespace -->
        <serviceName>/my_box_color</serviceName> <!-- Service topic name-->
        <color>1.0 1.0 1.0 1.0</color> <!-- Default Color -->
      </plugin>
    </visual>
  </gazebo>

  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/my_box</robotNamespace>
    </plugin>
  </gazebo>

</robot>

To execute the example, type:

$ roslaunch gazebo_ros_model_color test.launch # this launch the gazebo world

Test:

$ rosservice call /gz_client/model_color "light_name: ''
diffuse: {r: 0.5, g: 0.5, b: 0.0, a: 1.0}
attenuation_constant: 0.0
attenuation_linear: 0.0
attenuation_quadratic: 0.0"

References

Institution

Federal University of Minas Gerais (UFMG)
Computer Science Department
Belo Horizonte - Minas Gerais -Brazil

Laboratory

VeRLab

VeRLab: Laboratory of Computer Vison and Robotics
https://www.verlab.dcc.ufmg.br

About

This package contains a gazebo ros plugin which allows the user to dynamicly modified the color of the objects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CMake 54.6%
  • C++ 45.4%