Skip to main content
Jump to: navigation, search

Papyrus/customizations/robotics/faq


Frequently asked questions

Q: How can I install example models?

A: Use File -> NEW -> Examples. Then choose "Robotic examples" in the Papyrus category.

Q: How do I reference other models, notably service definitions in other models?

A: See reference handling.

Q: Which ROS version is supported?

A: ROS2 foxy and eloquent are supported. By default, ROS2 foxy is selected. This can be changed in the Eclipse preferences (type "ros2" in the filter box). There are some minor differences between the two version with respect to launch file generation.

Q: Is it possible to use existing ROS2 packages and service definitions?

A: Yes, Papyrus for Robotics comes with a library of all base service definitions. You can find them via "registered pathmaps" when you create a port. If you want to obtain existing definition from your ROS2 projects, see ROS2 reverse

=== Q: I get errors during build, saying that the project cannot be found by colcon A: Currently, the building of projects requires that the project has not been imported from a different location into the workspace. As the colcon command is executed in the current workspace location, it expects that the project that it tries to build is in the same location.

Q: How can I use namespaces?

A: The namespace concept in Papyrus for Robotics is basically that of UML, i.e. packages are namespaces. Nested packages can be created via the "new robotics child" menu in the model explorer. The UML package corresponds directly to C++ namespaces of component definitions (on the code level).

It's important, not to mix the package/namespace on this level with the packages in ROS2 that also form a namespace (but cannot be nested). All ROS2 elements (nodes, msg and service definitions) are located within a package/folder described by a package.xml. With respect to ROS2 code generation with P4R, the ROS2 package name corresponds to the name of the Eclipse project containing the component, system or service definition. The idea is that the Eclipse project (like the ROS2 one) forms a namespace for holding different model artefacts.

Q: How to model data-types via a text editor?

A: Data-types (or communication objects) can be created within a service definition diagram. It is possible to open an xtext-based text editor in the property view, if the data-type is selected in the model explorer or diagram. This editor supports completion and type validation. The latter is typically more efficient, if you need to add several attributes. Please note that the editor will not update the update, if there is an error, e.g. due to an unresolved type. In this case, the editor contents will be preserved in an annotation. You can open the editor again in order to fix validation errors.

Q: I've added attributes to a data-type, but there are not visible in the diagram

A: Remember that the diagram is a view of the model. Thus, it may show only a subset of the model information. If you add an attribute via a text editor or the model-explorer it will not automatically be shown in the diagram. Attributes can be added to the diagram via drag and drop from the model explorer.

Q: During code generation, I get an error message that a handler is missing

A: Handlers are callback functions that are invoked, if a message or response is received. For instance, a "Send" server port will invoke a handler, when a communication object is received. In order to associate a handler, add an activity, create an activity port and link it with the component-port via a connection. The creation of the connection will automatically create a function inside the activity, if none is created with the activity port yet. Please note that functions reference an activity port in order to avoid potential ambiguity.

Q: When editing a function, I only see its name and description (not the code)

A: there are two tabs at the bottom of the window, the "ID" and the "Function" tab. Activate the function tab in order to edit the code and kind of the function.

Q: I've opened a CDT editor but it does not synchronize

A: You need to open a specific variant of the CDT editor that synchronizes with the model. This editor can be invoked via the context menu from the diagram (select the component or an activity). The synchronizing status is indicated by a side-bar on the left of the editor. If it is green, the editor is synchronizing, if it is orange, it has stopped synchronizing. The latter happens if Eclipse is restarted or the associated model editor is closed by the user.

If a "normal" CDT editor on the generated file is currently open, it will get activated instead of opening the synchronizing editor. You can recognize this situation by the absence of the orange or green side-bar. Close the normal CDT editor first, if you need synchronization.

Q: I've modeled a ROS2 component, generated code, but the component does not seem to start

A: All components are mapped to ROS2 life-cycle nodes. Therefore, they need to be configured and activated. Please find a bash script starting an application in the shell script below. For instance, to start (and activate) the "subscriber" component of the shipped publish-subscribe example, use

 ros2 launch publishsubscribe activate.subscriber.py


Q: Reverse from file does not work

A: Be sure that the CDT project hosting a ROS2 package is configured in a way that at least the standard includes are found (e.g. add /opt/ros/foxy to the include directories).

Q: I cannot find my service definitions during port creation

A: Make sure you understand references.

Q: I'm starting a client and a server (or a publisher and a subscriber), but they do not communicate

A: In order to achieve reusability and loose coupling, the components of a system are defined independently. While a publisher and a subscriber have to use the same service definition in order to communicate, they might use different port names (that are mapped to topic names). When two ports are connected in the system assembly, re-mappings assure that both can communication. These mappings are configured via the generated launch scripts, but of course not used, if a node is directly started via "ros2 run". Use the generated launch scripts instead.

Q: I get the error "Cannot modify the current model" when I try to modify an existing skill model

A: Skill models created with old versions of Papyrus for Robotics are not compatible with those of release 0.8 and above.

For now, see the Task Modeling to understand how to adjust your skill model manually. A tool to allow automated migration of old models to the new version is under development.

Back to the top