Closed Kaju-Bubanja closed 1 year ago
While the _
indicates that these methods should not be used, here is an example how I got it working:
from sick_scan.srv._cola_msg_srv import ColaMsgSrv, ColaMsgSrv_Request
...
service_client = my_ros_node.create_client(ColaMsgSrv, "/ColaMsg")
future = service_client.call_async(ColaMsgSrv_Request(request='sRN DeviceIdent'))
rclpy.spin_until_future_complete(my_ros_node, future)
result = future.result()
print(result)
Looking at this guide it looks like we need to import from
from sick_scan.srv._cola_msg_srv import ColaMsgSrv_Request
but the underscore indicates that this method shouldn't be used and is private, also theColaMsgSrv_Request
looks auto generated and not meant for programmatic use. Which brings me to my question, how would I call the/ColaMsg
service from python instead of the cli?