Skip to content

Commit

Permalink
Minor updates on the README generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-nhg committed Dec 12, 2023
1 parent 13bafed commit e04026b
Showing 1 changed file with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ It holds the launch file to run the following nodes:
«getPortInfo(port
«ENDFOR»«ENDFOR»«ENDFOR»«ENDIF»

## Usage
## Installation

«IF system.fromFile.nullOrEmpty»
### Using release

«IF system.fromFile.nullOrEmpty»
This package can be copied to a valid ROS 2 workspace. To be sure that all the related dependencies are intalles the command **rosdep install** can be used.
Then the workspace must be compiled using the common ROS 2 build command:

Expand All @@ -54,6 +55,22 @@ colcon build
source install/setup.bash
```

«ELSE»
To launch this system there is already an existing package that contains the launch file.

The package can be easily installed with the following command:

```
sudo apt install ros-ROSDISTRO-«system.fromFile.split("/",2).get(0).replace("_","-")»
```

«ENDIF»


## Usage

«IF system.fromFile.nullOrEmpty»

To execute the launch file, the following command can be called:

```
Expand All @@ -67,15 +84,7 @@ sudo apt install xterm
```

«ELSE»
To launch this system there is already an existing package that contains the launch file.

The package can be easily installed with the following command:

```
sudo apt install ros-ROSDISTRO-«system.fromFile.split("/",2).get(0).replace("_","-")»
```

And the system started by executing:
To launch this system there is already an existing package that contains the launch file. It can be started by:

```
ros2 launch «system.fromFile.split("/",2).get(0)» «system.fromFile.substring(system.fromFile.lastIndexOf('/') + 1)»
Expand Down Expand Up @@ -103,25 +112,25 @@ ros2 launch «system.fromFile.split("/",2).get(0)» «system.fromFile.substring(
}

def getPortInfo(RosInterface port ){
if(port.reference.eClass.toString.contains("RosPublisherReference")){
if(port.reference.eClass.toString.contains("RosPublisherReference") && (port.reference as RosPublisherReferenceImpl).basicGetFrom.message !== null){
return "- Publisher: "+ port.name+" ["+(port.reference as RosPublisherReferenceImpl).basicGetFrom.message.fullname+"]"
}
if(port.reference.eClass.toString.contains("RosSubscriberReference")){
if(port.reference.eClass.toString.contains("RosSubscriberReference") && (port.reference as RosSubscriberReferenceImpl).basicGetFrom.message !== null){
return "- Subscriber: "+ port.name+" ["+(port.reference as RosSubscriberReferenceImpl).basicGetFrom.message.fullname+"]"
}
if(port.reference.eClass.toString.contains("RosServiceServerReference")){
if(port.reference.eClass.toString.contains("RosServiceServerReference") && (port.reference as RosServiceServerReferenceImpl).basicGetFrom.service !== null){
return "- ServiceServer: "+ port.name+" ["+(port.reference as RosServiceServerReferenceImpl).basicGetFrom.service.fullname+"]"
}
if(port.reference.eClass.toString.contains("RosServiceClientReference")){
if(port.reference.eClass.toString.contains("RosServiceClientReference") && (port.reference as RosServiceClientReferenceImpl).basicGetFrom.service !== null){
return "- ServiceClient: "+ port.name+" ["+(port.reference as RosServiceClientReferenceImpl).basicGetFrom.service.fullname+"]"
}
if(port.reference.eClass.toString.contains("RosActionServerReference")){
if(port.reference.eClass.toString.contains("RosActionServerReference") && (port.reference as RosActionServerReferenceImpl).basicGetFrom.action !== null){
return "- ActionServer: "+ port.name+" ["+(port.reference as RosActionServerReferenceImpl).basicGetFrom.action.fullname+"]"
}
if(port.reference.eClass.toString.contains("RosActionClientReference")){
if(port.reference.eClass.toString.contains("RosActionClientReference") && (port.reference as RosActionClientReferenceImpl).basicGetFrom.action !== null){
return "- ActionClient: "+ port.name+" ["+(port.reference as RosActionClientReferenceImpl).basicGetFrom.action.fullname+"]"
}
}
}



0 comments on commit e04026b

Please sign in to comment.