Skip to content
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

Pr vision cam #180

Closed
wants to merge 26 commits into from
Closed

Pr vision cam #180

wants to merge 26 commits into from

Conversation

EliaTarasov
Copy link
Contributor

This pr adds vision cam model to be able to test external vision without internal vision plugin (for example by using ROS).

<stddev>0.001</stddev>
</noise>
</camera>
<plugin name="svo_plugin" filename="libgazebo_ros_camera.so">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

svo_plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this model with external vision library which is called svo: https://github.com/uzh-rpg/rpg_svo. But it's up to user what name for plugin is preffered. We may call it vision_plugin.

</noise>
</camera>
<plugin name="vision_cam_plugin" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is 2 whitespaces.

@TSC21
Copy link
Member

TSC21 commented Feb 10, 2018

@EliaTarasov can you explain and exemplify why is this required and how can it be used? This should also be documented on the PX4 Devguide.

@EliaTarasov
Copy link
Contributor Author

EliaTarasov commented Feb 10, 2018

@TSC21
Explanation:
Currently the way we use vision pose estimation (vision plugin) is:

  1. We get an aircraft's world position and attitude from gazebo.
  2. We add white noise and random walk for "vision sensor".
  3. Send this to px4.

So here vision works always ok and we can't do much testing.
On the contrary, optical flow plugin allows us to actually test how real optical flow camera(PX4 Flow or other cam) would work if for example:

  1. We attach it to aircraft with different orientation.
  2. We attach gyro on that cam with different orientation.
  3. We choose ground plane not quite enough textured.
  4. We choose camera rate too high or to low.

So overall, optical flow plugin allows us to test some important math stuff behind.
What i want to add is the same capability for vision.

Example:
There is good enough ROS visual odometry library SVO and it works well both in sim and real tests.

@TSC21
Copy link
Member

TSC21 commented Feb 10, 2018

I see the point. But then I guess it makes sense to actually generalize this for other models by adding a sdf element to select the src for vision estimation (Gazebo itself or an external estimator).

@EliaTarasov
Copy link
Contributor Author

EliaTarasov commented Feb 10, 2018

Generalization looks better of course. Does it make sense to implement this sdf element on current commit?

@TSC21
Copy link
Member

TSC21 commented Feb 10, 2018

Yes I don't see a problem

@EliaTarasov
Copy link
Contributor Author

EliaTarasov commented Feb 11, 2018

I've added <vision_source> tag into gazebo vision plugin: branch
Solution looks somewhat awkward since plugin is loaded but not used if <vision_source> is "external".
Is it the way it should be done?

@TSC21
Copy link
Member

TSC21 commented Feb 12, 2018

Solution looks somewhat awkward since plugin is loaded but not used if <vision_source> is "external".

That's the point. If the vision source is external, that means that the vision plugin does not have to start, since there is another vision source producing and publishing data to gazebo_mavlink_interface.

@EliaTarasov
Copy link
Contributor Author

If the vision source is external, that means that the vision plugin does not have to start, since there is another vision source producing and publishing data to gazebo_mavlink_interface.

That's true.
The only solution that comes to mind is to add one additional external_vision_plugin which would have a tag like <visionPoseTopic> and it would somehow handle (maybe just remap) data before sending it to gazebo_mavlink_interface.
This looks redundant, but logical.
Is it worth to implement?

- since the airspeed axis is different for tailsitters we need to know
if the vehicle is a tailsitter or not

Signed-off-by: Roman <bapstroman@gmail.com>
Signed-off-by: Roman <bapstroman@gmail.com>
Signed-off-by: Roman <bapstroman@gmail.com>
Signed-off-by: Roman <bapstroman@gmail.com>
@TSC21
Copy link
Member

TSC21 commented Feb 13, 2018

The only solution that comes to mind is to add one additional external_vision_plugin which would have a tag like <visionPoseTopic> and it would somehow handle (maybe just remap) data before sending it to gazebo_mavlink_interface.

That makes sense to me. Can you implement and commit? Thanks

dogmaphobic and others added 3 commits February 19, 2018 11:23
This implements the Basic Camera Operations described by the Camera Protocol Documentation:
https://mavlink.io/en/protocol/camera.html

Only the very basic commands are implemented, providing image capture only (no video capture). Within the basic set of messages, all messages are implemented as well as all behaviors.

This "camera" component handles its own UDP "link" with the GCS. It emits its own heartbeats, and handles all the camera related communication between the GCS and the camera.
@EliaTarasov
Copy link
Contributor Author

EliaTarasov commented Feb 21, 2018

@TSC21 I did some research regarding last conversation and found that Gazebo vision topic cannot be easily filled by external vision subsystem's output. Basically we have two options:

  1. External vision plugin have to subscribe/advertise some external vision (e.g. Ros) topic.
  2. External vision subsystem (e.g. Ros) have to subscribe/advertise some Gazebo topic.

First option's drawback is that plugin's code become directly dependent on Ros which is not good for users want to use gazebo sim without Ros.
Second option's drawback is that user have to add some code relates to Gazebo inside external vision subsystem.

I think these two drawback are too much to be handled in master and now i work on integration of vision library directly into sitl_gazebo code (the way Optical Flow now works).
I'm not sure about three things:

  1. Is it acceptable to add some additional code which is large enough.
  2. How to handle additional repos for this library automatically during px4 firmware build.
  3. When i finish this branch.

So for now i would suggest to close this pr as it is not completely solve the original task.

@TSC21
Copy link
Member

TSC21 commented Feb 21, 2018

@EliaTarasov additional repos may represent a problem because of the licensing and we actually want to not depend on any kind of other repo. The PR itself should be generic in a way we don't need to rely on any other dependency and, at all. depend on ROS (unless the CMake option BUILD_ROS_INTERFACE is set to ON).

Signed-off-by: Roman <bapstroman@gmail.com>
RomanBapst and others added 10 commits February 22, 2018 20:02
- handling of the various actuation joints is handled via
channels specified in the sdf file of the model

Signed-off-by: Roman <bapstroman@gmail.com>
- this was causing unrealistically high side force when the vehicle was turning
and producing sideslip, as a result the vehicle would hardly turn

Signed-off-by: Roman <bapstroman@gmail.com>
@TSC21
Copy link
Member

TSC21 commented Mar 2, 2018

@EliaTarasov you need to rebase this.

@EliaTarasov
Copy link
Contributor Author

Closed as it was found not suitable for the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants