gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
733 stars 272 forks source link

[GUI] [Err] [Conversions.cc:1198] Attempting to convert a NavSat SDF sensor, but the sensor pointer is null. #2163

Closed ashBabu closed 1 year ago

ashBabu commented 1 year ago

Ubuntu 22.04, ROS2 Humble, Gazebo Fortress. Installed everything from apt repos

I have a differential drive robot on to which I have added a navsat sensor. I launch the simulation with ros2 launch skidy_bringup bringup_sim.launch.py. As soon as press the play button in gazebo, the following error comes up although I am able to see the msg being published at the topic that I specified.

[GUI] [Err] [Conversions.cc:1198] Attempting to convert a NavSat SDF sensor, but the sensor pointer is null.

azeey commented 1 year ago

It looks like we are missing a msgs -> sdf conversion for NavSat in gz::sim::convert(const msgs::Sensor) . Interestingly, it was left as a TODO in the original PR https://github.com/gazebosim/gz-sim/pull/1248. @ashBabu would you be able to add the conversion similar to how https://github.com/gazebosim/gz-sim/blob/f55212eb271a2f2b4d726da45e3aaeebede3b1a2/src/Conversions.cc#L1084-L1116 is done, but in the reverse direction in gz::sim::convert(const msgs::Sensor) https://github.com/gazebosim/gz-sim/blob/f55212eb271a2f2b4d726da45e3aaeebede3b1a2/src/Conversions.cc#L1366

ashBabu commented 1 year ago

Hi @azeey. I will try to update and create a PR asap

ashBabu commented 1 year ago

Hi @azeey : I did make a quick code edit as you can see here. However it doesnt solve the error but added another one

[GUI] [Err] [Conversions.cc:1198] Attempting to convert a NavSat SDF sensor, but the sensor pointer is null.
[Err] [Conversions.cc:1453] Attempting to convert an navsat sensor message, but the message does not have a navsat nested message.

Wondering if Im on the right track? Any pointers?

ashBabu commented 1 year ago

@azeey : Please ignore the above. I found out what I was doing wrong and a PR #2176 was made. Pls review it

23pointsNorth commented 1 year ago

I am attempting to use GPS/navsat sensor in Gazebo Garden, but I am hitting the same issues. Would the above PR make it in gz-sim7 or 8 as well?

ashBabu commented 1 year ago

@23pointsNorth : Although the error appears, the navsat sensor still publishes msgs. ign topic -e -t topic_name. If you want it in ROS, use the bridge

bridge = Node(
        package='ros_gz_bridge',
        executable='parameter_bridge',
        arguments=[
                   '/topic_name@sensor_msgs/msg/NavSatFix@ignition.msgs.NavSat',
                   ],
        output='screen'
    )

But to answer your question, someone from gazebo has to step in

mjcarroll commented 1 year ago

Closed by #2176

23pointsNorth commented 1 year ago

Is there a schedule on how quickly these changes will get propagated to published 6.x and 7.x?

azeey commented 1 year ago

Is there a schedule on how quickly these changes will get propagated to published 6.x and 7.x?

Generally, we wait for PRs that are close to getting in for the version/branch in question before making a release, but we can make a release sooner if necessary.