Giter Club home page Giter Club logo

cyberdog_sim's Introduction

Cyberdog SIM

整合cyberdog_locomotion与cyberdog_simulator仓库,实现gazebo与ROS2环境下的四足机器人仿真,同时,提供了基于Riz2的可视化工具,将机器人的状态lcm数据转发为ROS2 topics

详细信息可参照仿真平台文档

推荐安装环境: Ubuntu 20.04 + ROS2 Galactic

依赖安装

运行仿真平台需要安装如下的依赖
ros2_Galactic

$ sudo apt update && sudo apt install curl gnupg lsb-release
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
$ sudo apt update
$ sudo apt install ros-galactic-desktop

Gazebo

$ curl -sSL http://get.gazebosim.org | sh
$ sudo apt install ros-galactic-gazebo-ros
$ sudo apt install ros-galactic-gazebo-msgs

LCM

$ git clone https://github.com/lcm-proj/lcm.git
$ cd lcm
$ mkdir build
$ cd build
$ cmake -DLCM_ENABLE_JAVA=ON ..
$ make
$ sudo make install

Eigen

$ git clone https://github.com/eigenteam/eigen-git-mirror
$ cd eigen-git-mirror
$ mkdir build
$ cd build
$ cmake ..
$ sudo make install

xacro

$ sudo apt install ros-galactic-xacro

vcstool

$ sudo apt install python3-vcstool

colcon

$ sudo apt install python3-colcon-common-extensions

注意:若环境中安装有其他版本的yaml-cpp,可能会与ros galactic 自带的yaml-cpp发生冲突,建议编译时环境中无其他版本yaml-cpp

下载

$ git clone https://github.com/MiRoboticsLab/cyberdog_sim.git
$ cd cyberdog_sim
$ vcs import < cyberdog_sim.repos

编译

需要将src/cyberdog locomotion/CMakeLists.txt中的BUILD_ROS置为ON 需要在cyberdog_sim文件夹下进行编译

$ source /opt/ros/galactic/setup.bash 
$ colcon build --merge-install --symlink-install --packages-up-to cyberdog_locomotion cyberdog_simulator

使用

需要在cyberdog_sim文件夹下运行

$ python3 src/cyberdog_simulator/cyberdog_gazebo/script/launchsim.py

也可以通过以下命令分别运行各程序:

首先启动gazebo程序,于cyberdog_sim文件夹下进行如下操作:

$ source /opt/ros/galactic/setup.bash
$ source install/setup.bash
$ ros2 launch cyberdog_gazebo gazebo.launch.py

也可通过如下命令打开激光雷达

$ source /opt/ros/galactic/setup.bash
$ source install/setup.bash
$ ros2 launch cyberdog_gazebo gazebo.launch.py use_lidar:=true

然后启动cyberdog_locomotion的控制程序。打开cyberdog_sim文件夹新终端

$ source /opt/ros/galactic/setup.bash
$ source install/setup.bash
$ ros2 launch cyberdog_gazebo cyberdog_control_launch.py

最后打开可视化界面,于cyberdog_sim文件夹下进行如下操作:

$ source /opt/ros/galactic/setup.bash
$ source install/setup.bash
$ ros2 launch cyberdog_visual cyberdog_visual.launch.py

播放实机lcm log数据

该平台能够通过rviz2将实机的运动控制lcm数据进行播放和可视化。
操作方法如下: 运行lcm数据可视化界面,于cyberdog_sim文件夹下进行如下操作:

$ source /opt/ros/galactic/setup.bash
$ source install/setup.bash
$ ros2 launch cyberdog_visual cyberdog_lcm_repaly.launch.py

打开可视化界面后,通过运行cyberdog_locomotion仓的script目录下的脚本播放lcm log数据。
于cyberdog_sim文件夹下进行如下操作:

$ cd src/cyberdog_locomotion/scripts
$ ./make_types.sh #初次使用时需要运行
$ ./launch_lcm_logplayer.sh

运行后选择需要播放的lcm log文件,即可进行log数据的播放,此时通过rviz可视化界面能复现机器人的姿态。

cyberdog_sim's People

Contributors

562986047 avatar yangweiyou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.