zed-ros-wrapper icon indicating copy to clipboard operation
zed-ros-wrapper copied to clipboard

[Question] Custom vs Standard service types

Open bjsowa opened this issue 3 years ago • 4 comments

I noticed that you define a custom service type for each service in the zed_interfaces package. Why not just use a standard service types like std_srvs/SetBool and std_srvs/Trigger for most of the services? This way, other clients in the ROS network won't need to build the zed_interfaces package to, for example, reset the odometry.

I know that changing the ROS API can break some applications that use the current one, but I would like you to at least consider this in the future.

bjsowa avatar Sep 07 '20 10:09 bjsowa

Hi @bjsowa can you explain better what you mean and how you'd make such a feature? SetBool and Trigger do not have extended information, how can the node understand what service must be enabled/disabled/triggered?

Myzhar avatar Sep 07 '20 10:09 Myzhar

To give you an example:

You define zed_interfaces/reset_odometry type for the reset_odometry service. Instead, you could use the std_srvs/Trigger type and return the bool value in the success variable.

bjsowa avatar Sep 07 '20 11:09 bjsowa

Ah ok, that's clear. Yes, you are right. They are defined in the same way. However you cannot avoid using the zed_interfaces package because there are custom messages for the Object Detection module and the ZED2 sensors. But it could be useful to call ZED services from other nodes without adding the zed_interfaces dependency

Myzhar avatar Sep 07 '20 16:09 Myzhar

Tested this suggestion writing the new ROS2 wrapper for ROS2 Eloquent (https://github.com/stereolabs/zed-ros2-wrapper/commit/61ff87e4fe8ea634687676f7617e0ada28701b9f , https://github.com/stereolabs/zed-ros2-wrapper/commit/7dd59707a505d0d142edf47a60ac6292dc9ea8a6), it's a good suggestion and it will be replicated here with the new version that will be released with the new ZED SDK

Myzhar avatar Sep 30 '20 14:09 Myzhar