Hi Peter,
The ServiceTask works just like the regular ServiceProxy so what you are sending via the service is the value of a particular service type. The CHARGE_ROBOT example is using a service type of SetBatteryLevel which is defined in the rbx2_msgs/srv/SetBatteryLevel.srv file. This service type accepts a single float32 file and does not return anything back.
For an example of a service that accepts two values (easily extendible to more than two), take a look at the Add Two Integers service example in the ROS Tutorials. Note that the tutorial assumes that you have already created the service type for accepting the two integers and the steps to do that are explained in the Creating a srv tutorial. Once you complete those two tutorials, you would use a ServiceTask to add two integers as follows:
add_request = AddTwoIntsRequest()ADD_TWO_INTS = ServiceTask("ADD_TWO_INTS", "add_two_ints", AddTwoInts, add_request, result_cb=self.add_two_ints_cb)
where you would define the callback function self.add_two_ints_cb to process any return values.
--patrick
P.S. If the service you want to use already exists, then presumably it also has a service type and you would create a request using that type and send it in your ServiceTask like the AddTwoInts example below.
--patrick