Simulink ROS node with catkin build

16 ビュー (過去 30 日間)
Markus Krovinovitsch
Markus Krovinovitsch 2020 年 7 月 15 日
編集済み: Jakobus Louw 2021 年 9 月 30 日
Hi,
my Simulink ROS node does not work with a catkin workspace created with "catkin build".
But I have to use "catkin build" in this project.
Are there any settings for Simulink to solve this problem?

回答 (2 件)

Jakobus Louw
Jakobus Louw 2021 年 6 月 16 日
編集済み: Jakobus Louw 2021 年 9 月 30 日
My workaround is to first use catkin_make in catkin_ws_simulink, then copy the package produced in the src folder into my ~/catkin_ws (which was made with catkin build). Then run catkin build in ~/catkin_ws.
Step by step:
Follow the instructions on: Generate Code to Manually Deploy a ROS Node from Simulink, but INSTEAD of creating a catkin workspace with the catkin_init_workspace command like they say here (do not do this, this is just to show you what they say on the webstie):
mkdir -p ~/catkin_ws_simulink/src
cd ~/catkin_ws_simulink/src
catkin_init_workspace
Rather use catkin_make:
mkdir -p ~/catkin_ws_simulink/src
cd ~/catkin_ws_simulink
catkin_make
Then run the provided bash script to build the node:
cd ~
./build_ros_model.sh RobotController.tgz ~/catkin_ws_simulink
Copy the desired package folder inside ~/catkin_ws_simulink/src
Paste it in ~/catkin_ws/src (which was build with catkin build)
Now run:
cd ~/catkin_ws
catkin build
  1 件のコメント
Jakobus Louw
Jakobus Louw 2021 年 6 月 16 日
編集済み: Jakobus Louw 2021 年 6 月 16 日
You might be able to edit the build_ros_model.sh file they provide to rather use catkin build but I have not been able to make that work.

サインインしてコメントする。


Tohru Kikawada
Tohru Kikawada 2020 年 7 月 21 日
I was able to compile a generated ROS node from a Simulink model with "catkin build". Could you explain more about your problem?
$ catkin build
---------------------------------------------------------------
Profile: default
Extending: [env] /opt/ros/melodic
Workspace: /home/user/catkin_ws_build
---------------------------------------------------------------
Build Space: [exists] /home/user/catkin_ws_build/build
Devel Space: [exists] /home/user/catkin_ws_build/devel
Install Space: [unused] /home/user/catkin_ws_build/install
Log Space: [missing] /home/user/catkin_ws_build/logs
Source Space: [exists] /home/user/catkin_ws_build/src
DESTDIR: [unused] None
---------------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: None
---------------------------------------------------------------
Additional CMake Args: None
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
---------------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
---------------------------------------------------------------
Workspace configuration appears valid.
NOTE: Forcing CMake to run for each package.
---------------------------------------------------------------
[build] Found '1' packages in 0.0 seconds.
[build] Updating package table.
Starting >>> catkin_tools_prebuild
Finished <<< catkin_tools_prebuild [ 2.5 seconds ]
Starting >>> robotcontroller
Finished <<< robotcontroller [ 13.0 seconds ]
[build] Summary: All 2 packages succeeded!
[build] Ignored: None.
[build] Warnings: None.
[build] Abandoned: None.
[build] Failed: None.
[build] Runtime: 15.5 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.
  1 件のコメント
Markus Krovinovitsch
Markus Krovinovitsch 2020 年 9 月 17 日
編集済み: Markus Krovinovitsch 2020 年 9 月 17 日
Hi,
i want to generate the ros node (button in simulink: build and run) on a linux target hardware whose workspace was created with catkin build.
But this does not work, because Simulink expects an workspace created with catkin_make.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePublishers and Subscribers についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by