-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS Video Plugin for Gazebo - allows displaying an image stream in an OG... #86
ROS Video Plugin for Gazebo - allows displaying an image stream in an OG... #86
Conversation
… OGRE texture inside gazebo. Also provides a fix for ros-simulation#85.
// Initialize the ROS node and subscribe to cmd_vel | ||
int argc = 0; | ||
char** argv = NULL; | ||
ros::init(argc, argv, "gazebo_ros_video_plugin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not initialize your own ROS node. See the example here
Looks good otherwise, thanks for adding this! |
Removed ros initialization. Thanks for the pointer! |
Hmmm. I am facing a couple of problems with this:
|
It should be in the Load function, the example on the tutorial was wrong, my bad! |
@@ -0,0 +1,212 @@ | |||
/* | |||
* Copyright 2013 Open Source Robotics Foundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the file name to .cpp to match everything else?
I'll make the style changes. I am debugging a weird error with the plugin that I found after I removed the initialization call - it seems that Load for this plugin is getting called twice:
I'll update the pull request later today once I have debugged this error. |
I talked to John just now about this and we tested your code. The problem is that your visual rendering plugin is running for both gzserver and gzclient, which are two different processes. The gzserver already has a ros node initialized, but the gzclient does not. This is the first plugin in gazebo_plugins to be a Visual type, so I didn't realized this would happen but my advice to you to remove the ros::init() was wrong - add that back in :) Maybe name the node "gazebo_client" to indicate what process it belongs to? |
…er adherance to gazebo style guidelines
Thanks for the explanation, as I now understand all my observations. I have updated the code with the style changes. A node is only initialized if necessary, and there is a small hack which attempts to print whether the instance belongs to gzserver or gzclient. It will have to do for now. The PR is good to merge on my part, let me know if you spot anything amiss. |
I got it fully working on Baxter just now, I'm pretty excited about this new plugin as Rethink will probably us it! As a side note from @hsu, your implementation as I understand it does not actually write to the textures, it only displays the image in gzclient. Meaning if a camera or a video is made of the simulation, the video stream will not appear. A better future implementation would actually change the link's texture. But this is still really great work! Could you please document this plugin on the plugins wiki and include an XML example of the necessary gazebo tags? Thanks! |
ROS Video Plugin for Gazebo - allows displaying an image stream in an OG...
I'll document the plugin. I've got another plugin I want to submit a PR for. @hsu That's odd. I don't modify the link texture, but the external texture is visible in a camera/video stream (That's what I use it for). See http://farnsworth.csres.utexas.edu/share/gazebo_ros_video_output.png (I've put an output from my webcam on the simulated laptop screen, which is viewed by the camera on the controllable person model). |
bump to document the plugin on the wiki |
ROS Video Plugin for Gazebo - allows displaying an image stream in an OG...
...RE texture inside gazebo. Also provides a fix for #85.