Messages with an element that may not be present in the scene
Hi,
I'm creating a message that describes a vision result, where an element to grasp that may or may not be present in the scene.
# The timestamp of the capture
int timestamp 0
# Scene elements
Solid object_to_grasp
bool found_an_object_to_grasp
Solid[] obstacles
# Current pose
geometry_msgs/Pose current_tcp_pose
float64[] current_joints_pose
The solid is a complex type:
geometry_msgs/Pose center
geometry_msgs/Pose grasp_pose
Voxel[] voxels
float64 confidence
The issue with my message is that the "object_to_grasp" parameter cannot be filled if no object was found.
I'm not sure of what will happen if I feed None in the python interface of the client:
self.request:Scene.Request = Scene.Request()
request.object_to_grasp = None
And then send that to the server...
Will the code crash? Will the server find it and return None ?
Can I use this design, or shall I use a design with 2 distinct messages, with and without the object to grasp?
Thanks