fix
This commit is contained in:
+3
-2
@@ -109,7 +109,8 @@ from example_interfaces.srv import AddTwoInts
|
||||
|
||||
class AddTwoIntsServer(Node):
|
||||
def __init__(self):
|
||||
super().__init__('add_two_ints_server_py')
|
||||
# 节点名(实际本仓库无 _py 后缀,launch 也不重命名)
|
||||
super().__init__('add_two_ints_server')
|
||||
# create_service(srv_type, srv_name, callback)
|
||||
# callback 签名: callback(request, response) -> response
|
||||
self.srv = self.create_service(
|
||||
@@ -167,7 +168,7 @@ private:
|
||||
```python
|
||||
class Client(Node):
|
||||
def __init__(self):
|
||||
super().__init__('add_two_ints_client_py')
|
||||
super().__init__('add_two_ints_client')
|
||||
self.client = self.create_client(AddTwoInts, 'add_two_ints')
|
||||
|
||||
# 阻塞等服务端上线(1s 超时,循环等)
|
||||
|
||||
Reference in New Issue
Block a user