-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added NodeConfiguration to ConnectedNode and ComandLineLoader to Node…
…Configuration. Now possible to get command line remappings down into NodeMain from onStart
- Loading branch information
1 parent
753e16a
commit b4d7f38
Showing
6 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
|
||
package org.ros.internal.loader; | ||
|
||
|
||
import org.ros.CommandLineVariables; | ||
import org.ros.EnvironmentVariables; | ||
|
||
|
@@ -44,6 +43,14 @@ | |
* environment specification. When starting a node through RosRun, this class is used | ||
* to process the command line remappings. | ||
* | ||
* Remappings ":= on cmdl", get put in 'remappingArguments'. Those that are prefixed with "__" are put | ||
* into the speacialRemappings collection, those without into 'remappings' after taking Graph.nameOf of the remapped args. | ||
* Args on the cmdl without a remapping ":=" get put into nodeArguments. | ||
* | ||
* NOTE: If no constructor is detected during loadClass invocation, | ||
* A node with a static getInstance() returning a type of NodeMain will be invoked. If neither | ||
* an InstantiationException is thrown. This is an enhancement to node creation in original RosJava. | ||
* | ||
* @author [email protected] (Ken Conley) | ||
* @author [email protected] (Damon Kohler) | ||
*/ | ||
|
@@ -104,11 +111,27 @@ private void parseArgv() { | |
public String getNodeClassName() { | ||
return nodeClassName; | ||
} | ||
|
||
/** | ||
* Return a list of args on the cmdl that are not delimited by special := mapping modifier | ||
* @return | ||
*/ | ||
public List<String> getNodeArguments() { | ||
return Collections.unmodifiableList(nodeArguments); | ||
} | ||
|
||
/** | ||
* Return cmdl args with := but not __ prefix that have been translated to GraphName.of | ||
* @return | ||
*/ | ||
public Map<GraphName, GraphName> getRemappings() { | ||
return Collections.unmodifiableMap(remappings); | ||
} | ||
/** | ||
* Return cmdl args with __ at prefix | ||
* @return | ||
*/ | ||
public Map<String, String> getSpecialRemappings() { | ||
return Collections.unmodifiableMap(specialRemappings); | ||
} | ||
/** | ||
* Create NodeConfiguration according to ROS command-line and environment | ||
* specification. | ||
|
@@ -124,6 +147,7 @@ public NodeConfiguration build() { | |
if (specialRemappings.containsKey(CommandLineVariables.NODE_NAME)) { | ||
nodeConfiguration.setNodeName(specialRemappings.get(CommandLineVariables.NODE_NAME)); | ||
} | ||
nodeConfiguration.setCommandLineLoader(this); | ||
return nodeConfiguration; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters