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

Creates the backend of TopicInterfacePlugin. #385

Merged
merged 4 commits into from
Apr 26, 2021

Conversation

agalbachicar
Copy link
Collaborator

  • Subscribes to a topic and reads a google::protobuf::message,
  • parses the message into MessageWidget class to access the information and types easier.
  • Prints data to ignerr to show it works -- will change once the UI is in place.

- Subscribes to a topic and reads a google::protobuf::message,
- parses the message into MessageWidget class to access the information and types easier.
- Prints data to ignerr to show it works -- will change once the UI is in place.
@agalbachicar
Copy link
Collaborator Author

Note for the reviewers: there are several TODOs. I wanted to split the parsing procedure from the UI procedure because it is a bunch of code so far. Here is a dump of the scene with delphyne_mali2:

{ type: ignition.msgs.Scene, is_compound: true{ { origin_visual: { type: b, is_compound: false, value: { false } } }, { light: { type: ignition.msgs.Light, is_compound: true{ { parent_id: { type: j, is_compound: false, value: { 0 } } }, { diffuse: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 1 } } }, { b: { type: f, is_compound: false, value: { 0.9 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0.9 } } }, { r: { type: f, is_compound: false, value: { 0.9 } } },  } }, { range: { type: f, is_compound: false, value: { 0 } } }, { specular: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 1 } } }, { b: { type: f, is_compound: false, value: { 0.9 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0.9 } } }, { r: { type: f, is_compound: false, value: { 0.9 } } },  } }, { pose: { type: ignition.msgs.Pose, is_compound: true{ { orientation: { type: ignition.msgs.Quaternion, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { w: { type: d, is_compound: false, value: { 0 } } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { id: { type: j, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { position: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: { directional_light } } }, { attenuation_linear: { type: f, is_compound: false, value: { 0 } } }, { attenuation_constant: { type: f, is_compound: false, value: { 0 } } }, { direction: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { -0.5 } } }, { z: { type: d, is_compound: false, value: { -1 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { -0.5 } } },  } }, { spot_inner_angle: { type: f, is_compound: false, value: { 0 } } }, { type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 2, name: DIRECTIONAL } } }, { attenuation_quadratic: { type: f, is_compound: false, value: { 0 } } }, { spot_outer_angle: { type: f, is_compound: false, value: { 0 } } }, { cast_shadows: { type: b, is_compound: false, value: { true } } }, { spot_falloff: { type: f, is_compound: false, value: { 0 } } }, { id: { type: j, is_compound: false, value: { 0 } } },  } }, { grid: { type: b, is_compound: false, value: { false } } }, { fog: { type: ignition.msgs.Fog, is_compound: true{ { end: { type: f, is_compound: false, value: { 0 } } }, { start: { type: f, is_compound: false, value: { 0 } } }, { density: { type: f, is_compound: false, value: { 0 } } }, { color: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 0, name: NONE } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 500000000 } } }, { sec: { type: l, is_compound: false, value: { 7 } } },  } },  } }, { ambient: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { sky: { type: ignition.msgs.Sky, is_compound: true{ { humidity: { type: d, is_compound: false, value: { 0 } } }, { cloud_ambient: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { time: { type: d, is_compound: false, value: { 0 } } }, { wind_speed: { type: d, is_compound: false, value: { 0 } } }, { mean_cloud_size: { type: d, is_compound: false, value: { 0 } } }, { sunrise: { type: d, is_compound: false, value: { 0 } } }, { sunset: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { wind_direction: { type: d, is_compound: false, value: { 0 } } },  } }, { shadows: { type: b, is_compound: false, value: { false } } }, { model: { type: ignition.msgs.Model, is_compound: true{ { self_collide: { type: b, is_compound: false, value: { false } } }, { scale: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { deleted: { type: b, is_compound: false, value: { false } } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { is_static: { type: b, is_compound: false, value: { false } } }, { bounding_box: { type: ignition.msgs.AxisAlignedBox, is_compound: true{ { max_corner: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { min_corner: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } },  } }, { pose: { type: ignition.msgs.Pose, is_compound: true{ { orientation: { type: ignition.msgs.Quaternion, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { w: { type: d, is_compound: false, value: { 0 } } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { id: { type: j, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { position: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { link: { type: ignition.msgs.Link, is_compound: true{ { visual: { type: ignition.msgs.Visual, is_compound: true{ { type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 0, name: ENTITY } } }, { parent_name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { laser_retro: { type: d, is_compound: false, value: { 0 } } }, { id: { type: j, is_compound: false, value: { 2514647190 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { delete_me: { type: b, is_compound: false, value: { false } } }, { parent_id: { type: j, is_compound: false, value: { 0 } } }, { meta: { type: ignition.msgs.Visual.Meta, is_compound: true{ { layer: { type: i, is_compound: false, value: { 0 } } },  } }, { material: { type: ignition.msgs.Material, is_compound: true{ { pbr: { type: ignition.msgs.Material.PBR, is_compound: true{ { ambient_occlusion_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { specular_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { glossiness: { type: d, is_compound: false, value: { 0 } } }, { environment_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { roughness_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { albedo_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { glossiness_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 0, name: NONE } } }, { emissive_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { metalness_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { normal_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { metalness: { type: d, is_compound: false, value: { 0 } } }, { roughness: { type: d, is_compound: false, value: { 0 } } },  } }, { lighting: { type: b, is_compound: false, value: { false } } }, { emissive: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { specular: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { shader_type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 0, name: VERTEX } } }, { script: { type: ignition.msgs.Material.Script, is_compound: true{ { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { normal_map: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { ambient: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } }, { diffuse: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { cast_shadows: { type: b, is_compound: false, value: { false } } }, { transparency: { type: d, is_compound: false, value: { 0 } } }, { pose: { type: ignition.msgs.Pose, is_compound: true{ { orientation: { type: ignition.msgs.Quaternion, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { w: { type: d, is_compound: false, value: { 1 } } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { id: { type: j, is_compound: false, value: { 2514647190 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { position: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { geometry: { type: ignition.msgs.Geometry, is_compound: true{ { mesh: { type: ignition.msgs.MeshGeom, is_compound: true{ { center_submesh: { type: b, is_compound: false, value: { false } } }, { submesh: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { scale: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 1 } } }, { z: { type: d, is_compound: false, value: { 1 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 1 } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { filename: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: { /tmp/SShapeRoad.obj } } },  } }, { heightmap: { type: ignition.msgs.HeightmapGeom, is_compound: true{ { filename: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } }, { image: { type: ignition.msgs.Image, is_compound: true{ { pixel_format_type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 0, name: UNKNOWN_PIXEL_FORMAT } } }, { step: { type: j, is_compound: false, value: { 0 } } }, { height: { type: j, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { width: { type: j, is_compound: false, value: { 0 } } },  } }, { use_terrain_paging: { type: b, is_compound: false, value: { false } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { sampling: { type: j, is_compound: false, value: { 0 } } }, { size: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { width: { type: i, is_compound: false, value: { 0 } } }, { origin: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { height: { type: i, is_compound: false, value: { 0 } } },  } }, { image: { type: ignition.msgs.ImageGeom, is_compound: true{ { granularity: { type: i, is_compound: false, value: { 0 } } }, { height: { type: d, is_compound: false, value: { 0 } } }, { scale: { type: d, is_compound: false, value: { 0 } } }, { threshold: { type: i, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { uri: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { cylinder: { type: ignition.msgs.CylinderGeom, is_compound: true{ { length: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { radius: { type: d, is_compound: false, value: { 0 } } },  } }, { sphere: { type: ignition.msgs.SphereGeom, is_compound: true{ { radius: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } },  } }, { type: { type: N8delphyne3gui13MessageWidget9EnumValueE, is_compound: false, value: {  value: 6, name: MESH } } }, { box: { type: ignition.msgs.BoxGeom, is_compound: true{ { size: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } },  } }, { plane: { type: ignition.msgs.PlaneGeom, is_compound: true{ { d: { type: d, is_compound: false, value: { 0 } } }, { size: { type: ignition.msgs.Vector2d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { normal: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } },  } },  } }, { visible: { type: b, is_compound: false, value: { false } } }, { is_static: { type: b, is_compound: false, value: { false } } }, { scale: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } },  } }, { pose: { type: ignition.msgs.Pose, is_compound: true{ { orientation: { type: ignition.msgs.Quaternion, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { w: { type: d, is_compound: false, value: { 0 } } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { id: { type: j, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { position: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { enabled: { type: b, is_compound: false, value: { false } } }, { density: { type: ignition.msgs.Density, is_compound: true{ { density: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } },  } }, { id: { type: j, is_compound: false, value: { 147361781 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { inertial: { type: ignition.msgs.Inertial, is_compound: true{ { izz: { type: d, is_compound: false, value: { 0 } } }, { iyz: { type: d, is_compound: false, value: { 0 } } }, { iyy: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { pose: { type: ignition.msgs.Pose, is_compound: true{ { orientation: { type: ignition.msgs.Quaternion, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { w: { type: d, is_compound: false, value: { 0 } } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { id: { type: j, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { position: { type: ignition.msgs.Vector3d, is_compound: true{ { y: { type: d, is_compound: false, value: { 0 } } }, { z: { type: d, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { x: { type: d, is_compound: false, value: { 0 } } },  } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: {  } } },  } }, { ixx: { type: d, is_compound: false, value: { 0 } } }, { mass: { type: d, is_compound: false, value: { 0 } } }, { ixz: { type: d, is_compound: false, value: { 0 } } }, { ixy: { type: d, is_compound: false, value: { 0 } } },  } }, { self_collide: { type: b, is_compound: false, value: { false } } }, { name: { type: NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, is_compound: false, value: { surface } } }, { gravity: { type: b, is_compound: false, value: { false } } }, { canonical: { type: b, is_compound: false, value: { false } } }, { kinematic: { type: b, is_compound: false, value: { false } } },  } }, { id: { type: j, is_compound: false, value: { 2 } } },  } }, { background: { type: ignition.msgs.Color, is_compound: true{ { a: { type: f, is_compound: false, value: { 0 } } }, { b: { type: f, is_compound: false, value: { 0 } } }, { header: { type: ignition.msgs.Header, is_compound: true{ { stamp: { type: ignition.msgs.Time, is_compound: true{ { nsec: { type: i, is_compound: false, value: { 0 } } }, { sec: { type: l, is_compound: false, value: { 0 } } },  } },  } }, { g: { type: f, is_compound: false, value: { 0 } } }, { r: { type: f, is_compound: false, value: { 0 } } },  } },  }

@agalbachicar
Copy link
Collaborator Author

In 19098ce I fixed the serialization string. I tested it with a shorter message, /clock:

{
  type: ignition.msgs.Clock,
  is_compound: true,
  children:
  {
    {
      real:
      {
        type: ignition.msgs.Time,
        is_compound: true,
        children:
        {
          {
            nsec: { type: i, is_compound: false, value: { 0 } }
          },
          {
            sec: { type: l, is_compound: false, value: { 0 } }
          },
        },
      }
    },
    {
      header:
      {
        type: ignition.msgs.Header,
        is_compound: true,
        children:
        {
          {
            stamp:
            {
              type: ignition.msgs.Time,
              is_compound: true,
              children:
              {
                {
                  nsec: { type: i, is_compound: false, value: { 0 } }
                },
                {
                  sec: { type: l, is_compound: false, value: { 0 } }
                },
              },
            }
          },
        },
      }
    },
    {
      sim: 
      {
        type: ignition.msgs.Time,
        is_compound: true,
        children:
        {
          {
            nsec: { type: i, is_compound: false, value: { 784999999 } }
          },
          {
            sec: { type: l, is_compound: false, value: { 7 } }
          },
        },
      }
    },
    {
      system:
      {
        type: ignition.msgs.Time,
        is_compound: true,
        children:
        {
          {
            nsec: { type: i, is_compound: false, value: { 0 } }
          },
          {
            sec: { type: l, is_compound: false, value: { 0 } }
          },
        },
      }
    },
  },
}

And the igntion message defition is:

message Clock
{
  /// \brief Optional header data
  Header header = 1;

  Time system = 2;
  Time real   = 3;
  Time sim    = 4;
}

where Time is:

message Time
{
  /// \brief Seconds
  int64 sec = 1;

  /// \brief Nanoseconds
  int32 nsec = 2;
}

and Header:

message Header
{
  message Map {
    string key = 1;
    repeated string value = 2;
  }

  Time stamp           = 1;
  repeated Map data             = 2;
} 

Copy link
Collaborator

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

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

Nice Job! LGTM

I will take a look again at the reflection logic later on just to be sure, I didn't fully get when fieldDescriptor->is_repeated().


const auto fieldType = fieldDescriptor->type();

const std::string fieldName = fieldDescriptor->name();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't directly call it scopedName ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Thanks!

private:
/// @brief Parses @p msg and stores the values into `variantValue` or
/// `children`.
void Parse(google::protobuf::Message* msg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: msg to _msg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

const std::unordered_map<std::string, std::unique_ptr<MessageWidget>>& Children() const { return children; }

private:
/// @brief Parses @p msg and stores the values into `variantValue` or
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is Parse method storing the values in variantValue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Comment on lines 94 to 101
// Build the message widget.
if (!msgType.empty()) {
auto newMsg = ignition::msgs::Factory::New(msgType, "");
if (!newMsg) {
ignerr << "Unable to create message of type[" << msgType << "] "
<< "widget will be initialized when a message is received." << std::endl;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I don't get what this is for.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed. Nothing, it was part of the migration but it is not needed.


signals:

protected:
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: remove not used sections.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

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

LGTM

@agalbachicar agalbachicar merged commit b12edb9 into master Apr 26, 2021
@agalbachicar agalbachicar deleted the agalbachicar/#332_topic_interface_ign_gui_3 branch April 26, 2021 13:38
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.

2 participants