PenGUIn is a custom frontend for the ros2 framework, which is used to launch all available nodes and control the values of the topics and services of our ros2 projects.
- Install the Rosbridge by running this command:
sudo apt-get install ros-<rosdistro>-rosbridge-server
- Download the frontend from the release page
- Unzip the archive and note the folder where you unzipped it
- Move the launch node package to your ros2 workspace and build your workspace
- Unzip the frontend build, move into the new folder and launch the frontend build When moving the frontend make sure to move all included subdirectories to the same location and keep the structure the way it's been right after unzipping the archive, because otherwise important assets and more can't be located.
- Download the archive with the packages from the release page
- Move the archive into the
/srcfolder your workspace and unzip it
Since the install already includes a launch file, you can run the bridge as follows:
source /opt/ros/<rosdistro>/setup.bash
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
The default port is 9090.
- Clone the
penguin_controll_packageas well as thepenguin_interface_packageinside your ros2 workspace - After cloning the required packages, open a new terminal and run
colcon build - Source the environment:
source install/setup.bash - Then launch the control node using this command:
ros2 run penguin_controll_package penGUIn_controller
- Navigate to the install folder
- Double click on the file called "frontend"
In order to add a node, which you want to launch and introspect via this frontend, to the list of available node, navigate to the install folder of the frontend and look for /config.
Inside this folder open the nodes_config.json file and edit it like this:
[
{
"executableName": "", // The executable name of your node
"packageName": "", // The package name
"nodeName": "", // Optional: The name of a node returned by `ros2 node list`, otherwise the executable name is used
"description": "", // Optional: A short description
"documentationLink": "", // Optional: A link to the official documentation
"customCMD": "", // Optional: Set a custom cmd, default is `ros2 run <pkg> <exe>`
"isSelected": false // Optional: Whether it will be selected by default or not
}
]
Since you need to configure each topic, service or action for the analytics part, navigate to the install folder of the frontend and open the analytics.json file within the /config folder.
This file is supposed to be configured as like this:
[
{
"type": "Topic", // Define whether it's a topic/service/action
"name": "name", // The name of the topic/service/action
"description": "*optional*", // Optional: A short description
"category": "*optional*" // Optional: Category for filtering
}
]
Since we want to support as many robots as possible with this single UI, you'll have to configure your desired controls manually. Therefore navigate to the install folder and open the controls_config.json within the /config folder.
This file is supposed to be configured as follows:
{
"joystick": {
"function": { // Define a function used to provide the input
"tag": "", // One of the supported functions
"type": "", // The full type of the interface
"topic": "" // The topic that's used
}
},
"horizontalSliders": [
{
"label": "", // Set a label for the slider
"function": { // Define a function used to provide the input
"tag": "", // The topic that's used
"type": "", // The topic that's used
"topic": "" // The topic that's used
},
"centered": false // If true the sliders 0 coordinate is centred, otherwise it's left-sided
}
],
"verticalSliders": [
{
"label": "", // Set a label for the slider
"function": { // Define a function used to provide the input
"tag": "", // One of the supported functions
"type": "", // The full type of the interface
"topic": "" // The topic that's used
},
"centered": false // If true the sliders 0 coordinate is centred, otherwise it's left-sided
}
],
"cameras": [
{
"label": "" // Set a label for a camera
}
],
"robot-ip": "127.0.0.1" // The IP address of the robot
}
Further information about the tags of all available functions can be found here.
Since there might be a lot of irrelevant log entries, you might want to hidde certain sources as follows:
[
"/path/file.cpp", // Ignore a certain file
"/path/*" // Ignore a certain directory
]
This is a known bug, which is caused by a wrong configuration causing rosapi to be unable to retrieve information about a certain node. Since rosapi can't handle this, it keeps crashing. So in order to fix this check your node configuration and restart the WebSocket server. (This is no frontend bug, but a rosapi bug. Please don't open an issue about this.)
If you've moved the frontend to another location, check whether you moved the subfolders too, because without those subfolders, the frontend might not launch.
In order to fix this reinstall the frontend where you want it and copy the whole /config folder into the archiv after unzipping it.
This is how the communication between your robot and the frontend works:
ros2 nodes
|
| DDS
|
WebSocket server (ROSbridge)
|
| JSON
|
Frontend
Further ressources: