open-rdc / aiformula

2 stars 0 forks source link

シミュレーションの環境設定 #97

Open yasuohayashibara opened 1 month ago

yasuohayashibara commented 1 month ago

Ubuntu20.04でシミュレーションの環境を作成する.

以下が参考になる. https://github.com/open-rdc/aiformula_docker

yasuohayashibara commented 1 month ago

あくまでも参考であるが,以下の環境を用意

以下で確認

import torch
import torchvision
import torchaudio

print(torch.__version__)
print(torchvision.__version__)
print(torchaudio.__version__)

ROS2 foxy 以下を参考にインストール https://qiita.com/porizou1/items/53053ce806304fd71f06

以下を参照して,ros2_wsとYOLOPを用意 https://github.com/open-rdc/aiformula_docker/blob/main/Dockerfile

このとき,YOLOPを入れたあとにcolcon build --symlink-installをするとZEDが無いとビルドエラーが出るのでシミュレータ環境だけであれば,以下を削除する.

rm -r ~/ros2_ws/YOLOP/toolkits/deploy
yasuohayashibara commented 1 month ago

実行は以下のコマンド

ros2 launch simulator gazebo_simulator.launch.py
ros2 run road_detector road_detector --device 0
ros2 run lane_line_publisher lane_line_publisher
ros2 run handle_controller handle_controller
ros2 launch teleop_twist_joy teleop-launch.py joy_config:=xbox

以下を参照 https://github.com/open-rdc/aiformula_docker

yasuohayashibara commented 1 month ago

起動するノードとトピックのデータ

コマンド

ros2 launch simulator gazebo_simulator.launch.py

rosgraph

node

/camera_driver
/gazebo
/joint_state_publisher
/joint_state_publisher
/robot_state_publisher
/robot_state_publisher
/turtlebot3_diff_drive
/turtlebot3_imu
/turtlebot3_joint_state

topic

/camera/camera_info
/camera/image_raw
/clock
/cmd_vel
/imu
/joint_states
/odom
/parameter_events
/performance_metrics
/robot_description
/rosout
/tf
/tf_static

コマンド

ros2 run road_detector road_detector --device 0

rosgraph

node

/road_detector

topic

/aiformula_perception/road_detector/mask_image
/aiformula_perception/road_detector/result_image

コマンド

ros2 run lane_line_publisher lane_line_publisher

rosgraph

node

/lane_line_publisher

topic

/aiformula_perception/lane_line_publisher/bev_points
/line_points

コマンド

ros2 run handle_controller handle_controller

rosgraph

node

/handle_controller

topic

/joy

コマンド

ros2 launch teleop_twist_joy teleop-launch.py

rosgraph

node

/joy_node
/teleop_twist_joy_node

topic

/joy/set_feedback
yasuohayashibara commented 1 month ago

handle_controller/joyをサブスクライブして,/cmd_velをパプリッシュするだけである. teleop-launch.pyと干渉するため,現時点では実行しないほうが良い.