Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master(ROS1) into ros2 branch #37

Merged
merged 13 commits into from
Dec 20, 2021
Merged

Conversation

ShotaAk
Copy link
Contributor

@ShotaAk ShotaAk commented Dec 15, 2021

What does this implement/fix?

masterブランチ(ROS 1) の変更を ros2ブランチへ取り込みます。

launchファイルは移植できなかったため、下記のように手を加えています。

  • lidar_frameオプションを追加
    • xacro_optionは移植していません。必要になったタイミングで実装します
  • namespaceオプションを追加
  • use_rvizオプションを追加
    • use_guiは移植していません。必要になったタイミングで実装します

Does this close any currently open issues?

いいえ

How has this been tested?

Ubuntu 20.04 & ROS 2 Foxy環境で下記の項目を確認しています。

$ ros2 launch raspimouse_description display.launch.py でモデルが表示されることを確認しました

image

$ ros2 launch raspimouse_description display.launch.py lidar:=urg lidar_frame:=testでURG付きモデルが表示されることを確認しました

image

また、$ ros2 run tf2_tools view_frames.py を実行し、生成されたframes.pdfを表示し、lidarのリンク名が変更されていることを確認しています。

image

下記コマンドを個別のターミナルで実行し、rvizとjoint_state_publisherが1つずつしか起動しないこと、
rviz上に2つのラズパイマウスが表示されることを確認しています。

$ ros2 launch raspimouse_description display.launch.py namespace:=test1
$ ros2 launch raspimouse_description display.launch.py namespace:=test2 use_rviz:=false
$ ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 world test1/base_footprint
$ ros2 run tf2_ros static_transform_publisher 0.5 0 0 0 0 0 world test2/base_footprint

image

Any other comments?

gazeboの設定についてはROS 2版のraspimouse_simの開発と並行して整えていきます。

Checklists

  • I have read the CONTRIBUTING guidelines.
  • I have checked to ensure there aren't other open Pull Requests for the same change.

Tiryoh and others added 8 commits September 28, 2021 16:43
* Fix wheel link missing problem

Also, add comments about params

-wheelTorque: 5
+wheelTorque: 500

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>

* Fix typo to suppress warnings loading GazeboPlugin

same as rt-net/jnmouse_description#9

* Fix default namespace to avoid odometry tf error

related: rt-net/raspimouse_sim#55

* Refactor

* Add an option to load gazebo plugin to allow URDF to be loaded without gazebo_ros

* Separate DiffDriveController into separate files

* Add laser link option

* s/laser_frame/lidar_frame/g

* Update lidar_frame name option

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
* Add GitHub repository description to README

* Update README.md

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
* Fix wheel link missing problem

Also, add comments about params

-wheelTorque: 5
+wheelTorque: 500

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>

* Fix typo to suppress warnings loading GazeboPlugin

same as rt-net/jnmouse_description#9

* Fix default namespace to avoid odometry tf error

related: rt-net/raspimouse_sim#55

* Refactor

* Add an option to load gazebo plugin to allow URDF to be loaded without gazebo_ros

* Separate DiffDriveController into separate files

* Add laser link option

* s/laser_frame/lidar_frame/g

* Update lidar_frame name option

* Avoid slipping

* Separate option parts

Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
* Update model and add RT Corporation logo

* Fix main circuit board position

* Update xacro option

* Fix merge error

a25febe

* Refactor

* Optimize collada

* Add URDF with URG
* Add a simple launch file to load robot description

* Merge into single launch file

* Refactor

lowercase letters are introduced as an example
https://wiki.ros.org/roslaunch/XML#if_and_unless_attributes
@ShotaAk ShotaAk changed the title merge master into ros2 branch merge master(ROS1) into ros2 branch Dec 15, 2021
@ShotaAk ShotaAk marked this pull request as ready for review December 15, 2021 06:28
@ShotaAk ShotaAk requested a review from Tiryoh December 15, 2021 06:28
Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • $ ros2 launch raspimouse_description display.launch.py でモデルが表示されること
  • $ ros2 launch raspimouse_description display.launch.py lidar:=urg lidar_frame:=test_frame でURG付きモデルが表示されること
    • $ ros2 run tf2_tools view_frames.py を実行してリンク名が変わっていること

Screenshot from 2021-12-15 18-04-06

上記確認しました

@Tiryoh Tiryoh self-assigned this Dec 16, 2021
Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ ros2 launch raspimouse_description display.launch.py namespace:=test1
$ ros2 launch raspimouse_description display.launch.py namespace:=test2 use_rviz:=false
$ ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 world test1/base_footprint
$ ros2 run tf2_ros static_transform_publisher 0.5 0 0 0 0 0 world test2/base_footprint

上記を実行すると2台とも同じjoint_state_publisher_guiの状態が反映されてしまうようです。

ScreenRecord-2021-12-16_19.24.51.mp4

また、launchで呼び出すノード名が同じためワーニングが出ています。

$ ros2 node list
WARNING: Be aware that are nodes in the graph that share an exact name, this can have unintended side effects.
/joint_state_publisher
/robot_state_publisher
/robot_state_publisher
/rviz2
/static_transform_publisher_4nyZeL3zSvkKdN8y
/static_transform_publisher_TS3iokZfTF7cGlA8
/transform_listener_impl_55f08e714050

ROS 1の方ではROS_NAMESPACE変数を使うという方法がありましたが、手元で試したところ、ROS 2ではどうもros2 launchでは反映されないようです。

https://discourse.ros.org/t/giving-a-turtlebot3-a-namespace-for-multi-robot-experiments/10756

Discourseの投稿を見るとNode()node_namespace='tb3_0'を追加しているようです。

どう名前空間を分けるのがいいでしょうかね 🤔

@ShotaAk
Copy link
Contributor Author

ShotaAk commented Dec 20, 2021

@Tiryoh
PushRosNamepsaceを使って、ノードのネームスペースを分けられるようにしました。

# 引数でネームスペースを指定
$ ros2 launch raspimouse_description display.launch.py namespace:=test1

# ノード一覧を表示
$ ros2 node list
/test1/joint_state_publisher
/test1/robot_state_publisher
/test1/rviz2
/test1/transform_listener_impl_55a1d46b9380

Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認しました。

$ ros2 launch raspimouse_description display.launch.py namespace:=test1
$ ros2 launch raspimouse_description display.launch.py namespace:=test2 use_rviz:=false
$ ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 world test1/base_footprint
$ ros2 run tf2_ros static_transform_publisher 0.2 0 0 0 0 0 world test2/base_footprint
$ ros2 run joint_state_publisher_gui joint_state_publisher_gui --ros-args -r __ns:=/test2

Screenshot from 2021-12-20 19-02-27

rosgraph

ScreenRecord-2021-12-20_18.57.47.mp4

@Tiryoh Tiryoh merged commit b9487f2 into ros2 Dec 20, 2021
@Tiryoh Tiryoh deleted the feature/ros2/port_ros1_changes branch December 20, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants