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

Feature: add multi sensor subscription #411

Merged
merged 5 commits into from
Feb 13, 2020

Conversation

TSC21
Copy link
Member

@TSC21 TSC21 commented Feb 12, 2020

This adds the possibility to the gazebo_mavlink_interface to subscribe dynamically to multiple sensor sources connected to a model. I started with the lidar sensors, but this can be extended to multiple other sources (like GPS's, multiple camera sources, others).

To do:

  • Extend to sonars and other sensors;
  • Add a model example with an array of multiple distance sensors.

This feature potentiates the development of onboard sense-and-avoid algorithms. Some changes were also required on the simulator module in PX4. PR following upstream.

@dagar @jkflying @Jaeyoung-Lim @mrivi @baumanta FYI.

@TSC21
Copy link
Member Author

TSC21 commented Feb 13, 2020

@mrivi I just extended the iris_obs_avoid model with 4 lidars (one downward, one forward, one left and one right facing). Here's an example output of listener distance_sensor:

pxh> listener distance_sensor

TOPIC: distance_sensor 4 instances

Instance 0:
 distance_sensor_s
	timestamp: 5856000  (0.048000 seconds ago)
	min_distance: 0.2000
	max_distance: 15.0000
	current_distance: 0.2000
	variance: 0.0000
	h_fov: 0.0524
	v_fov: 0.0524
	q: [0.7071, -0.0000, -0.7071, -0.0000]
	signal_quality: -1
	type: 0
	id: 0
	orientation: 25

Instance 1:
 distance_sensor_s
	timestamp: 5856000  (0.048000 seconds ago)
	min_distance: 0.2000
	max_distance: 15.0000
	current_distance: 0.2200
	variance: 0.0000
	h_fov: 0.0524
	v_fov: 0.0524
	q: [-1.0000, 0.0000, -0.0000, -0.0000]
	signal_quality: -1
	type: 0
	id: 1
	orientation: 0

Instance 2:
 distance_sensor_s
	timestamp: 5856000  (0.048000 seconds ago)
	min_distance: 0.2000
	max_distance: 15.0000
	current_distance: 0.2300
	variance: 0.0000
	h_fov: 0.0524
	v_fov: 0.0524
	q: [0.5000, 0.5000, -0.5000, 0.5000]
	signal_quality: -1
	type: 0
	id: 2
	orientation: 2

Instance 3:
 distance_sensor_s
	timestamp: 5860000  (0.044000 seconds ago)
	min_distance: 0.2000
	max_distance: 15.0000
	current_distance: 0.2100
	variance: 0.0000
	h_fov: 0.0524
	v_fov: 0.0524
	q: [0.5000, -0.5000, -0.5000, -0.5000]
	signal_quality: -1
	type: 0
	id: 3
	orientation: 6

Copy link
Contributor

@julianoes julianoes left a comment

Choose a reason for hiding this comment

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

Looks correct from what I can tell. Only one small comment.

include/gazebo_mavlink_interface.h Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants