1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

roscoreを複数立ち上げる

Last updated at Posted at 2022-10-07

1つのPCに複数のrosアプリケーションを立ち上げたいとき、それぞれのアプリケーションの命名などを意識してシステム開発をするのが面倒だなと思いroscoreを複数立ち上げる方法を調べました.

使用環境はubuntu20.04 ros noeticです.

方法としては,ROS_MASTER_URIroscore-pオプションをのポート番号を一致させることで実現できます.

では実際に行っていきます.

まず1つ目のroscoreをたちあげます.ターミナルを開いて以下コマンドを実行していきます(11311番ポートに立ち上げ)

roscore1
export ROS_MASTER_URI=http://127.0.0.1:11311
roscore -p 11311

次に2つ目のターミナルを開き以下のように実行します(11312番ポートに立ち上げ)

roscore2
export ROS_MASTER_URI=http://127.0.0.1:11312
roscore -p 11312

結果以下のようにroscoreを2つ立ち上げることができました.

Screenshot from 2022-10-07 19-43-51.png

プログラム実行前にexport ROS_MASTER_URI=http://127.0.0.1:11312のように立ち上げたいポート番号の指定は必要になると思います.アプリケーション間のつながりを疎にしたい場合に活用できそうです.

reference

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?