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

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

Open
yasuohayashibara opened this issue Aug 15, 2024 · 4 comments
Open

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

yasuohayashibara opened this issue Aug 15, 2024 · 4 comments

Comments

@yasuohayashibara
Copy link
Member

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

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

@yasuohayashibara
Copy link
Member Author

yasuohayashibara commented Aug 15, 2024

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

  • CPU i7-9750H + GPU RTX2070 + memory 16GB
  • Ubuntu20.04
  • python3.8
  • nvidiaドライバ470.256.02 (nvidia-smiで確認)
  • cuda11.4 (nvcc --version'で確認)
    以下でインストール
https://developer.nvidia.com/cuda-11-4-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local

~/.bashrcに以下を追加

export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • torch 2.0.0+cu117
  • torchvision 0.15.2+cu117
  • torchaudio 2.0.1+cu117

以下で確認

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
Copy link
Member Author

yasuohayashibara commented Aug 15, 2024

実行は以下のコマンド

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
Copy link
Member Author

yasuohayashibara commented Aug 15, 2024

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

コマンド

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant