Connect to ROS service server
Use rossvcclient
or ros.ServiceClient
to
create a ROS service client object. This service client uses a persistent connection to
send requests to, and receive responses from, a ROS service server. The connection
persists until the service client is deleted or the service server becomes
unavailable.
Use the ros.ServiceClient
syntax when connecting to a specific ROS
node.
creates a service client with the given client
= rossvcclient(servicename
)ServiceName
that connects to, and gets its ServiceType
from, a
service server. This command syntax prevents the current MATLAB® program from running until it can connect to the service
server.
provides additional options specified by one or more
client
= rossvcclient(servicename
,Name,Value)Name,Value
pair arguments.
[
returns a new service request message in client
,reqmsg
]
= rossvcclient(___)reqmsg
, using
any of the arguments from previous syntaxes. The message type of
reqmsg
is determined by the service that
client
is connected to. The message is initialized
with default values. You can also create the request message using rosmessage
.
client = ros.ServiceClient(
creates a service client that connects to a service server. The client gets
its service type from the server. The service client attaches to the
node
, name
)ros.Node
object handle,
node
.
client = ros.ServiceClient(
specifies a timeout period in seconds for the client to connect the service
server.node
, name
,"Timeout",timeout
)
rosmessage | Create ROS messages |
call | Call the ROS service server and receive a response |