How to get object dimension using RayShape ?

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi guys,

I'm simulating communication between 2 robots in Gazebo and ROS.

My robots are exchanging RayShape beam to control if there is an object between them. I'm already using the GetIntersection() to get the distance to the obstacle and its name and I was wondering if there was a way to get more information about the object the ray collides with ?

Does the Scale() function retunrs the dimension of the RayShape object or the obstacle ? it's not clear to me.

Also I saw a function called GetSDF(), it says that it returns the SDF values, is it possible to get the dimension from it maybe ?