Author: | Geoffrey Biggs and contributors |
---|---|
Date: | 2015-08-13 |
Copyright: | LGPL3 |
Version: | 4.0 |
Manual section: | 1 |
Manual group: | User commands |
rtcomp [options] <manager[:name]|composite component path>
Composes multiple components into a single composite component, exposing a selection of their ports externally. A new composition can be created or an existing composition edited. New members can be added to and members removed from existing compositions, and the exported ports list can be changed. The type of composition to create can be specified.
The required option is either the path to an existing composition to edit, or the path to a manager to create the composition in. If a manager is specified, a name for the new composition can be specified, separated from the manager path by a colon. If a name is not specified, a default name will be chosen. See the Examples section for examples.
When specifying components to add or remove, a list of ports to export or hide can be specified after the component path, separated from the path by a colon. The ports in the list should be comma-separated. See the Examples section for examples.
-a ADD, --add=ADD | |
A component to include in the composition. Specify a comma-separated list of ports to export after the component name, separated by a colon. | |
-o OPTIONS, --options=OPTIONS | |
Extra options to pass to the component on creation. | |
-r REMOVE, --remove=REMOVE | |
A component or ports to remove from the composition. | |
-t TYPE, --type=TYPE | |
Type of composite component to create. [Default: PeriodicECSharedComposite] |
--version | Show program's version number and exit |
-h, --help | Show a help message and exit |
-v, --verbose | Output verbose information. [Default: False] |
rtshell uses paths to indicate objects in the RTC Tree. A path is the address of object. Name servers and naming contexts on name servers are considered directories. Managers and RT-Components are considered 'files'. As with the POSIX cat command, the path specified as an argument to commands is appended to the current rtshell working directory, which is stored in the RTCSH_CWD environment variable and changeable using the rtcwd command.
The available paths depend on the known name servers at the time the command is executed. This is a combination of the servers listed in the RTCSH_NAMESERVERS environment variable and the servers used in given paths.
For example, /localhost/comp0.rtc refers to the component named comp0.rtc registered on the name server at localhost. /localhost/manager/comp0.rtc refers to the component comp0.rtc in the directory manager on the localhost name server. ./comp0.rtc refers to that component in the current directory.
When specifying a port on an RT-Component, it should be placed after the path, separated by a colon. For example, /localhost/comp0.rtc:data refers to the port data on the component comp0.rtc.
Some commands that create new ports accept extra options in the paths, such as a name for the automatically generated port, or a formatter. The format for specifying these paths is:
path:port.name#formatter
For example:
/localhost/blurg.host_cxt/comp0.rtc:input.stuff#a_printer
This specifies that the automatically generated port should be named stuff, and the data type it handles should be printed using the a_printer function (which must be available, usually it is provided by the user in a loadable module). The port will be connected to the input port of the comp0.rtc component.
The name component is optional. If it is not present, neither should the . character be. For example:
/localhost/blurg.host_cxt/comp0.rtc:input#a_printer
The formatter component is optional. If it is not present, neither should the # character be. For example:
/localhost/blurg.host_cxt/comp0.rtc:input.stuff
- RTCTREE_ORB_ARGS
- A list of arguments, separated by semi-colons, to pass to the ORB when creating it. Optional.
- RTCTREE_NAMESERVERS
- A list of name server addresses, separated by semi-colons, to parse when creating the RTCTree. Each server in the list will be added to the tree, making it available for browsing with rtshell. Optional.
- RTSH_CWD
- The current working directory in the tree. Do not set this variable; it is set automatically by rtshell.
The only variable that should normally be set by the user is RTCTREE_NAMESERVERS. Set this to a list of name server addresses, separated by semi-colons, that rtshell should interact with. For example, in a Bash shell, the following command will set the known name serves to localhost, 192.168.0.1:65346 and example.com:
$ export RTCTREE_NAMESERVERS=localhost;192.168.0.1:65346;example.com
Returns zero on success and non-zero on failure.
Verbose output and error messages are printed to stderr.
$ rtcomp /localhost/manager.mgr:MotorUnit -a /localhost/Motor0.rtc:out -a /localhost/Controller0.rtc:in,out
Create a composite component using the Motor0.rtc and Controller0.rtc components, exposing the in and out ports of Controller0.rtc and the out port of Motor0.rtc. The component's instance name will be MotorUnit.
$ rtcomp /localhost/MotorUnit.rtc -a /localhost/Sensor0.rtc:out
Edit the existing MotorUnit.rtc composite component, adding the Sensor0.rtc component as a new user and exporting its out port.
$ rtcomp /localhost/MotorUnit.rtc -a /localhost/Sensor0.rtc:in
Edit the existing MotorUnit.rtc, which already contains Sensor0.rtc as a member, to export the in port of Sensor0.rtc.
$ rtcomp /localhost/MotorUnit.rtc -r /localhost/Sensor0.rtc:out
Edit the existing MotorUnit.rtc, which already contains Sensor0.rtc as a member, to hide the out port of Sensor0.rtc.
$ rtcomp /localhost/MotorUnit.rtc -r /localhost/Controller0.rtc:in,out
Edit the existing MotorUnit.rtc, which already contains Controller0.rtc as a member, to hide the in and out ports of Controller0.rtc.
$ rtcomp /localhost/MotorUnit.rtc -r /localhost/Controller0.rtc -r /localhost/Motor0.rtc
Edit the existing MotorUnit.rtc, which already contains Controller0.rtc and Motor0.rtc as a members, to remove them from the composition.
rtmgr (1)