-
 

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 2.1.2
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version humble
Last Updated 2023-06-09
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

No additional authors.

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS 2 package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use ros2 launch fmi_adapter_examples simple_damped_pendulum.launch.py to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at topic /a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

To print the angle data on another console, invoke ros2 topic echo /a.

damped_pendulum_with_transport_delay.launch.py starts two nodes named /example/damped_pendulum and /example/transport_delay. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /example/y.

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Use the generic launch file of the package ros2 launch fmi_adapter fmi_adapter_node.launch.py fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may print the pendulum’s angle to the console by ros2 topic echo /revolute1_angle

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If fmi_adapter crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

2.1.2 (2023-04-13)

2.1.1 (2021-06-11)

2.1.0 (2021-03-24)

  • Adapted launch files to API changes.

2.0.0 (2021-03-24)

0.1.8 (2020-05-14)

  • Prepared for Foxy release.

0.1.7 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

0.1.6 (2019-11-05)

  • Release for ROS 2 Eloquent.

0.1.5 (2019-05-24)

  • Added example of launch file with new node composition feature.

0.1.4 (2019-05-23)

  • Fixed link to FMU-SDK.

0.1.3 (2019-02-01)

0.1.2 (2019-01-25)

  • Cleaned up dependency entries in package.xml.

0.1.1 (2019-01-23)

  • Fixed missing testing and launch dependencies.

0.1.0 (2019-01-18)

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 2.1.2
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version rolling
Last Updated 2023-06-09
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

No additional authors.

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS 2 package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use ros2 launch fmi_adapter_examples simple_damped_pendulum.launch.py to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at topic /a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

To print the angle data on another console, invoke ros2 topic echo /a.

damped_pendulum_with_transport_delay.launch.py starts two nodes named /example/damped_pendulum and /example/transport_delay. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /example/y.

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Use the generic launch file of the package ros2 launch fmi_adapter fmi_adapter_node.launch.py fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may print the pendulum’s angle to the console by ros2 topic echo /revolute1_angle

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If fmi_adapter crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

2.1.2 (2023-04-13)

2.1.1 (2021-06-11)

2.1.0 (2021-03-24)

  • Adapted launch files to API changes.

2.0.0 (2021-03-24)

0.1.8 (2020-05-14)

  • Prepared for Foxy release.

0.1.7 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

0.1.6 (2019-11-05)

  • Release for ROS 2 Eloquent.

0.1.5 (2019-05-24)

  • Added example of launch file with new node composition feature.

0.1.4 (2019-05-23)

  • Fixed link to FMU-SDK.

0.1.3 (2019-02-01)

0.1.2 (2019-01-25)

  • Cleaned up dependency entries in package.xml.

0.1.1 (2019-01-23)

  • Fixed missing testing and launch dependencies.

0.1.0 (2019-01-18)

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 2.1.2
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version rolling
Last Updated 2023-06-09
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

No additional authors.

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS 2 package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use ros2 launch fmi_adapter_examples simple_damped_pendulum.launch.py to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at topic /a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

To print the angle data on another console, invoke ros2 topic echo /a.

damped_pendulum_with_transport_delay.launch.py starts two nodes named /example/damped_pendulum and /example/transport_delay. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /example/y.

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Use the generic launch file of the package ros2 launch fmi_adapter fmi_adapter_node.launch.py fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may print the pendulum’s angle to the console by ros2 topic echo /revolute1_angle

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If fmi_adapter crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

2.1.2 (2023-04-13)

2.1.1 (2021-06-11)

2.1.0 (2021-03-24)

  • Adapted launch files to API changes.

2.0.0 (2021-03-24)

0.1.8 (2020-05-14)

  • Prepared for Foxy release.

0.1.7 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

0.1.6 (2019-11-05)

  • Release for ROS 2 Eloquent.

0.1.5 (2019-05-24)

  • Added example of launch file with new node composition feature.

0.1.4 (2019-05-23)

  • Fixed link to FMU-SDK.

0.1.3 (2019-02-01)

0.1.2 (2019-01-25)

  • Cleaned up dependency entries in package.xml.

0.1.1 (2019-01-23)

  • Fixed missing testing and launch dependencies.

0.1.0 (2019-01-18)

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 2.1.2
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version rolling
Last Updated 2023-06-09
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

No additional authors.

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS 2 package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use ros2 launch fmi_adapter_examples simple_damped_pendulum.launch.py to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at topic /a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

To print the angle data on another console, invoke ros2 topic echo /a.

damped_pendulum_with_transport_delay.launch.py starts two nodes named /example/damped_pendulum and /example/transport_delay. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /example/y.

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Use the generic launch file of the package ros2 launch fmi_adapter fmi_adapter_node.launch.py fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may print the pendulum’s angle to the console by ros2 topic echo /revolute1_angle

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If fmi_adapter crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

2.1.2 (2023-04-13)

2.1.1 (2021-06-11)

2.1.0 (2021-03-24)

  • Adapted launch files to API changes.

2.0.0 (2021-03-24)

0.1.8 (2020-05-14)

  • Prepared for Foxy release.

0.1.7 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

0.1.6 (2019-11-05)

  • Release for ROS 2 Eloquent.

0.1.5 (2019-05-24)

  • Added example of launch file with new node composition feature.

0.1.4 (2019-05-23)

  • Fixed link to FMU-SDK.

0.1.3 (2019-02-01)

0.1.2 (2019-01-25)

  • Cleaned up dependency entries in package.xml.

0.1.1 (2019-01-23)

  • Fixed missing testing and launch dependencies.

0.1.0 (2019-01-18)

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 1.0.4
License Apache License 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version melodic_and_noetic
Last Updated 2022-11-22
Dev Status MAINTAINED
CI status
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

  • Ralph Lange

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use roslaunch fmi_adapter_examples simple_damped_pendulum.launch to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at /fmi_adapter_node/a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

damped_pendulum_with_transport_delay.launch starts two nodes. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /transport_delay/y.

Both launch files also open rqt_plot to visualize the angle(s).

Plot created by damped_pendulum_with_transport_delay.launch

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Either use the generic launch file of the package roslaunch fmi_adapter fmi_adapter_node.launch fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu or invoke the package’s node directly by rosrun fmi_adapter node _fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may visualize the pendulum’s angle over time by rqt_plot /fmi_adapter_node/revolute1_angle

DampedPendulum.fmu simulation results in rqt_plot

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If the fmi_adapter node crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

1.0.4 (2021-03-22)

  • Ensured same relative location for sample FMUs in devel and install layout.

1.0.3 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

1.0.2 (2018-10-12)

  • Added two sample FMUs with corresponding launch files.

1.0.1 (2018-07-16)

  • Throwing runtime_error in case of failed fmi2 function call in FMIAdapter.

1.0.0 (2018-07-13)

  • Initial version.

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange

No version for distro galactic. Known supported distros are highlighted in the buttons above.

fmi_adapter_examples package from fmi_adapter repo

fmi_adapter fmi_adapter_examples

Package Summary

Tags No category tags.
Version 1.0.4
License Apache License 2.0
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/boschresearch/fmi_adapter.git
VCS Type git
VCS Version melodic_and_noetic
Last Updated 2022-11-22
Dev Status MAINTAINED
CI status
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Provides small examples for use of the fmi_adapter package

Additional Links

Maintainers

  • Ralph Lange

Authors

  • Ralph Lange

General information about this repository, including legal information, build instructions and known issues/limitations, are given in README.md in the repository root.

The fmi_adapter_examples package

This ROS package provides few examples for the use of the fmi_adapter package. It contains two FMU files DampedPendulum.fmu and TransportDelay.fmu (both created with the FMU SDK) and corresponding launch files. Furthermore, it includes a model of a damped pendulum in the Modelica language to create your own FMU.

Running the provided sample FMUs

Use roslaunch fmi_adapter_examples simple_damped_pendulum.launch to simulate a damped pendulum (share/DampedPendulum.fmu) with a length of 1m. The pendulum’s angle is published at /fmi_adapter_node/a with the default rate of 100Hz. The step size of the FMU’s solver is 1ms.

damped_pendulum_with_transport_delay.launch starts two nodes. The first one simulates share/DampedPendulum.fmu, where the length parameter is set to 25m by the launch file. The second node runs share/TransportDelay.fmu, where the delay parameter is set to 2.33s. The input subscription of the transport delay is remapped to the pendulum’s angle topic and the delayed angle is published at /transport_delay/y.

Both launch files also open rqt_plot to visualize the angle(s).

Plot created by damped_pendulum_with_transport_delay.launch

Create and simulate your own DampedPendulum.fmu

There are several modeling tools that support the Modelica language and provide FMU export. Examples are Dymola, JModelica, and OpenModelica.

In the following, we explain the process by the example of OpenModelica, which has been also used to create the model of the damped pendulum at share/DampedPendulum.mo.

Screenshot of the DampedPendulum model in OMEdit V1.14.1

  • Navigate to Tools -> Options -> FMI and ensure that Version=2.0, Type=Co-Simulation and Platforms=Dynamic is selected.
  • Then click File -> Export -> FMU.
  • The path of the resulting FMU file is shown in the message browser at the bottom of the window, typically /tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu.

Now, you are prepared for simulating the FMU using the fmi_adapter package.

  • Either use the generic launch file of the package roslaunch fmi_adapter fmi_adapter_node.launch fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu or invoke the package’s node directly by rosrun fmi_adapter node _fmu_path:=/tmp/OpenModelica_[user]/OMEdit/DampedPendulum/DampedPendulum.fmu

  • You may visualize the pendulum’s angle over time by rqt_plot /fmi_adapter_node/revolute1_angle

DampedPendulum.fmu simulation results in rqt_plot

Please see the README.md of the fmi_adapter package for how to load and run an FMU inside an application-specific ROS node or library.

Note on bug with mmc_mk_modelica_array in OpenModelica 1.12.0: If the fmi_adapter node crashes with the error message undefined symbol: mmc_mk_modelica_array, please patch the files

  • /usr/include/omc/c/meta/meta_modelica.h
  • /usr/include/omc/c/meta/meta_modelica_data.h

according to https://github.com/OpenModelica/OMCompiler/pull/2397/files and export the FMU again. Details on this bug are given in https://trac.openmodelica.org/OpenModelica/ticket/4899.

CHANGELOG

Changelog for package fmi_adapter_examples

1.0.4 (2021-03-22)

  • Ensured same relative location for sample FMUs in devel and install layout.

1.0.3 (2020-01-30)

  • Updated instructions for FMU export from OpenModelica.
  • Created explicit output revolute1_angle.

1.0.2 (2018-10-12)

  • Added two sample FMUs with corresponding launch files.

1.0.1 (2018-07-16)

  • Throwing runtime_error in case of failed fmi2 function call in FMIAdapter.

1.0.0 (2018-07-13)

  • Initial version.

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Package Dependencies

System Dependencies

No direct system dependencies.

Dependant Packages

No known dependants.

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged fmi_adapter_examples at Robotics Stack Exchange