6.1. Concepts
Here is a presentation which explains main concepts of LN.
6.1.1. Topics and Services
6.1.1.1. Rules for Topic Names
6.1.2. Message Definitions
6.1.3. state objects and their management
6.1.4. Overview on LN parameters
6.1.5. Clients
6.1.5.1. Client Name Selection
After initializing a client, the client name is selected as follows:
If the client process was started by the LN manager, the manager creates and passes an environment variable named
LN_PROGRAM_NAMEto the process, with the name taken from the corresponding process section of the LN manager configuration.If the client was not started by the LN manager, the LN client code tries to use the parameter which is passed in the client constructor as name of the client.
This requested name is passed to the LN manager, which does the registration, and watches that there is no name collision. If there is already another client with the same name registered, the LN manager takes this suggested name and appends an integer number to it, until it reaches a unique name.
The rationale for this selection steps is that it is possible to start independent processes with some parameters which control different parts of the same robot, for example a left and a right arm, or a specific wheel on a four-wheeled robot. It is also possible that clients defined in a library module are sometimes running in the same process, and sometimes running separately, for example, for debugging, or in a entirely different hardware configuration.
new with LN 2.6 (LN_LIBRARY_VERSION >= 26):
if the user-provided client_name starts with the prefix "exact:" the client library will ignore that LN_PROGRAM_NAME env-var and will ask the manager for the exact client name after the colon :. If the manager can not
provide this name, the client construction will fail and return error LNE_CLNT_NAME_IN_USE.