-
Notifications
You must be signed in to change notification settings - Fork 290
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
Custom rendering sensor example #1673
Comments
A stereo camera example could be useful, it was available in Gazebo Classic, but there's nothing similar in the new Gazebo/Ignition. |
Hey, I would like to work on this issue. |
Hello there, I'll get to work on implementing this. Will do some poking around to get a few ideas, and hopefully I and my team will be able to get something figured out! |
Thanks @JEller98. I'll assign this to you. @tejalbarnwal Did you ever get a chance to work on this? |
Hi @azeey , |
@tejalbarnwal no worries. Just checking to make sure we are not duplicating our efforts. @JEller98 please go ahead! |
Hello there, my teammates had a few questions regarding this issue; we're fairly new to this, so apologies if any of these seem redundant: What are the specifications of this request? Any information regarding these questions would be much appreciated. |
…; code is completely untested and no tests have been written for it.
…; code is completely untested and no tests have been written for it.
I would love a custom rendering sensor example. I'm working on implementing an optical flow plugin for PX4. I've got it working with a custom plugin by adding a "camera" sensor to my models sdf, saving the latest frame in the OnImage callback, and then calculating/publishing flow in the Update() function of the class inheriting from Sensor. I'd like to instead have my plugin inherit directly from CameraSensor. I'm not sure if this is even the right approach though, since CameraSensor::Load(_sdf) doesn't work due to it expecting sdf::SensorType::CAMERA when in reality it's CUSTOM. Can you advise? I would like to eventually expand this idea to a VSLAM plugin with stereo cameras. |
For your use case, one workaround to try is override bool CustomCameraSensor::Load(const sdf::Sensor &_sdf)
sdf::Sensor sdfSensor sdfCopy = _sdf;
sdfCopy.SetType(sdf::SensorType::CAMERA);
CameraSensor::Load(sdfCopy);
// load your other custom parameters
} |
@iche033 thanks, let me know if we should move this to Discord or a separate thread. I tried this along with setting the camera sensor
However it's still not quite right.
This is how I am creating it in my model.sdf
|
Looks like the camera sdf is not populated if the type is You can parse the from sdf by doing: sdf::Sensor sdfCopy = _sdf;
sdfCopy.SetType(sdf::SensorType::CAMERA);
sdf::Camera cam;
cam.Load(sdfCopy.Element()->FindElement("camera"));
sdfCopy.SetCameraSensor(cam);
...
if (!CameraSensor::Load(sdfCopy)) {
|
@iche033 It doesn't work either. I'm thinking that this is not a supported thing for custom sensor plugins. I've been looking through the source code and it doesn't appear to be designed for this usage. |
Desired behavior
We have a custom sensor example here : https://github.com/gazebosim/gz-sim/tree/ign-gazebo6/examples/plugin/custom_sensor_system , and it would be nice to have a custom rendering sensor example as well, that people could use as a template to write their own rendering sensors.
Implementation suggestion
We could leverage #1475, and use osrf/lrauv#213 and a guide. A start could be a camera sensor modified in a trivial way, like mirroring the image.
The text was updated successfully, but these errors were encountered: