Creating RtActivities

DeviceInterfaces expose methods that create RtActivities. An RtActivity can be seen as an operation that may be executed by the device it has been created for. This section shows how to use DeviceInterfaces to create Activities. The execution semantics of Activities is explained in the next section. As an example, a Light Weight Robot device and its PtpInterface is used here. Other devices and DeviceInterfaces can be used in the same way. Consider the documentation of the respective Robotics API extension packages to find out about DeviceInterfaces and Activities supported by other devices.

The DeviceInterface PtpInterface provides Activities for fast robot motions. It provides, among others, two methods (see chapter 2 for detailed documentation):

Note that the ptp() method described above returns a RtActivity of the type MotionProgressActivity, a more concrete subtype of RtActivity. This does not matter for the following explanation though.

Calling one of those methods does not actually perform the respective operation, but just instantiates an RtActivity that represents this operation. This explicit modeling of operations as RtActivities leaves developers with different choices in how to actually execute an operation: Synchronous and asynchronous execution of single RtActivities is described in section 1.4.4, the combination of single RtActivities to more complex operations is explained in section 1.5.

Usually, methods of DeviceInterfaces that create RtActivities take a set of DeviceParameters as optional arguments. These can be used to modify device-specific parameters that have to be obeyed by the RtActivity (like e.g., maximum joint velocities during motion). The use of DeviceParameters is explained further in section 1.4.5.


Calling methods of DeviceInterfaces just instantiates operations (represented by RtActivities), but does not execute them.