Skip to content

leepl37/gazebo-rust-cli-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gazebo 로봇 프로그래밍 시작 프로젝트 (macOS)

이 프로젝트는 Gazebo에서 로봇 제어를 시작하기 위한 최소 구성입니다.

핵심 흐름:

  1. Gazebo 설치
  2. 커스텀 월드 실행
  3. 토픽으로 속도 명령 전송
  4. Rust CLI 컨트롤러로 상호작용 제어

1) macOS에서 Gazebo 설치

방법 A: Homebrew (권장)

./scripts/install_gazebo_macos.sh

수동 설치:

brew tap osrf/simulation
brew install gz-harmonic

설치 확인:

gz sim --versions

방법 B: Docker (로컬 설치 실패 시)

macOS 버전/그래픽 드라이버 이슈가 있으면 Docker(우분투 기반)로 실행할 수 있습니다.

2) 시뮬레이터 실행

프로젝트 루트에서 실행:

gz sim -s worlds/simple_robot_world.sdf -r --render-engine-server ogre2 --render-engine-server-api-backend metal

다른 터미널에서 GUI 실행:

gz sim -g --render-engine-gui ogre2 --render-engine-gui-api-backend metal

3) 수동 제어 테스트

다른 터미널에서 1회 명령 전송:

gz topic -t /model/mybot/cmd_vel -m gz.msgs.Twist -p "linear: {x: 0.5} angular: {z: 0.0}" -n 1

연속 전송:

gz topic -t /model/mybot/cmd_vel -m gz.msgs.Twist -p "linear: {x: 0.4} angular: {z: 0.2}" -r 10

4) Rust CLI 컨트롤러 실행 (권장)

cd rust-cli-controller
cargo run --bin cli

GUI 패널 실행:

cd rust-cli-controller
cargo run --bin gui

프로젝트 구조

  • worlds/simple_robot_world.sdf: 시뮬레이터 월드 + 차동구동 로봇 모델
  • scripts/install_gazebo_macos.sh: Homebrew 설치 스크립트
  • rust-cli-controller/: 1주차 Rust 터미널 컨트롤러

다음 단계(코드 레벨)

  1. SDF에 센서 추가(Lidar, Camera, IMU)
  2. 센서 토픽 구독 후 의사결정 로직 작성
  3. 상태 머신(FSM) 도입(탐색/회피/목표 이동)
  4. 로그 저장 및 재생으로 디버깅 강화

문제 해결 가이드

  • gz 명령을 못 찾는 경우:
    source ~/.zshrc
  • gz는 되는데 gz sim이 없으면:
    brew install gz-sim8 gz-gui8 gz-launch7 gz-physics7 gz-sensors8
    gz --commands
    gz sim --versions
  • macOS에서 GUI가 깨지거나 크래시 나면 렌더러 백엔드(ogre2 + metal/opengl)를 바꿔서 재시도
  • 로봇이 안 움직이면 토픽 목록과 타입을 확인:
    gz topic -l

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors