Add a light to Turtlebot
How can I add a structure indicating head-lamp to Turtlebot and then attached point/spot light to that structure? I am using ROS kinetic and Gazebo 7.
Asked by Ash_100 on 2017-10-03 12:31:36 UTC
Answers
You can use the AttachLightPlugin
, here's an example.
Asked by chapulina on 2017-10-03 13:08:15 UTC
Comments
Thanks. I am already using it. I was able to build it successfully and test it. But I have two questions (1) How to dynamically turn off/on the green spot light? (2) How such a light could be integrated to Turtlebot since I can't find Turtlebot description in SDF format, therefore, can't attach a light to a link?
Asked by Ash_100 on 2017-10-03 13:33:11 UTC
@Ash_100 Did you managed to turn ON/OFF the light dynamically? I have seen your other question but did not managed to interact with the rendering part from the model plugin.
Asked by rreignier on 2017-11-07 12:44:31 UTC
To turn lights on/off, you can send a Gazebo message to ~/visual altering its emissive values. An example here: https://bitbucket.org/osrf/gazebo/src/4f8e0728b55fd2827cbab3395d792bef218a5aae/examples/stand_alone/stop_light/stop_light.cc?at=citysim&fileviewer=file-view-default
Asked by chapulina on 2017-11-08 15:05:00 UTC
@chapuline Thanks!<
I was sending a message to ~/light/modify to change the colors of diffuse and specular (between Black and White).
Which solution would you recommend?
Asked by rreignier on 2017-11-09 05:42:04 UTC
Also, since I have added the AttachLightPlugin (on 9 lights), I have noticed that gzclient (v8.1 from OSRF repos) leaks memory quite quickly so I cannot keep simulation more than 10 minutes open. Did you also notice that behavior?
Asked by rreignier on 2017-11-09 14:53:19 UTC
ha, I'm pretty sure I deleted the earlier comment right after I posted and realized you were taking ab out real lights, not "visual LEDs". Bug in Gazebo Answers... Anyway, ~/light/modify should be the way to go, this is how gzclient does it.
Asked by chapulina on 2017-11-09 15:34:23 UTC
As for performance, you could wait for the next Gazebo 7 release ;) https://bitbucket.org/osrf/gazebo/pull-requests/2807/add-light-as-child-of-link/diff
Asked by chapulina on 2017-11-09 15:35:28 UTC
Interesting. Thanks! When you talk about performance, you refer to my memory leak issue? About "Visual LEDs", I cannot attach them to links, right? An about the mentioned PR, if it lands in Gazebo 7, it should also arrives in Gazebo 8, isn't it?
Asked by rreignier on 2017-11-09 16:17:31 UTC
Yes, memory leak relates to performance. By "visual LEDs" I mean changing the emissive color of a visual like this, so it's not a light and will not affect objects around it: https://twitter.com/chapulinaBR/status/920436448024596481. Sure, the PR will first need to land on gz7 and then be ported to gz8.
Asked by chapulina on 2017-11-09 16:28:32 UTC
Ok thanks, I see the difference now. Indeed, I need the real lights. So I am now waiting for the merge of the PR.
Asked by rreignier on 2017-11-10 04:10:07 UTC
Is it possible to have the light inside the model without declaring it in the world ?
Asked by patrickelectric on 2017-11-20 09:27:59 UTC
With the new implementation, it should work that way.
But working with ROS and URDF file, it does not seem to work because the URDF to SDF converter get rid of the
Asked by rreignier on 2018-03-19 11:25:12 UTC
Comments