Giter Club home page Giter Club logo

robomaster-simulator's Introduction

ICRA RoboMaster AI Challenge Simulator

Build Status Codacy Badgeplatform License: GPL v3

RM simulator made by Living Machine Lab, ShanghaiTech University

Background

This project is aimed to build a simulator for ICRA RoboMaster AI Challenge. Through the simulator, a lot of Deep Reinforcement Learning algorithms can be tested and train a good policy for the competition. It may also require transfer learning to overcome the gap between sim to real.

This repository contains:

  1. Latest 2020 arena map with RoboMaster Visual Tag.
  2. Robot Model
  3. Compatible with the RoboRTS package.
  4. Multi-agent navigation based on multi-jackle ROS package.
  5. Referee system
    • bunos and supply function.
    • also handle the shooting function(whether the robot shoot the enemy successfully).
  6. Connect gazebo with OpenAi gym framework by openai_ros ROS package.

Preview

Arena

Install

Dependencies

First, install the ROS and the melodic version is recommended (http://wiki.ros.org/melodic/Installation).

$ sudo apt install protobuf-compiler
$ sudo apt install libprotoc-dev
$ sudo apt install ros-melodic-libg2o
$ sudo apt install ros-melodic-controller-manager
$ sudo apt install ros-melodic-realtime-tools 
$ sudo apt install ros-melodic-rosserial-server
$ sudo apt install ros-melodic-serial
$ sudo apt install ros-melodic-robot-localization
$ sudo apt install libgoogle-glog0v5 libgoogle-glog-dev
$ sudo apt install ros-melodic-move-base
$ sudo apt install ros-melodic-interactive-marker-twist-server
$ sudo apt install ros-melodic-gazebo-ros-control
$ sudo apt install ros-melodic-hector-gazebo-plugins
$ sudo apt install ros-melodic-joint-state-controller 
$ sudo apt install ros-melodic-joint-trajectory-controller
$ sudo apt install ros-melodic-lms1xx
$ sudo apt install libarmadillo-dev
$ sudo apt install ros-melodic-map-server

The robot gazebo model contains pointgrey cameras. So it is required to install pointgrey camera driver in your computer. The driver file is named flycapture2-2.11.3.121-amd64-pkg.tgz. Extract this file and run the install script.

$ echo "y\n" | sudo ./install_flycapture_only_simulation.sh

If there is some dependency problem, you may use

$ sudo apt --fix-broken install

Install RoboMaster Visual Tag

$ git submodule update --init --recursive
$ cp -R src/rm_simulator/models/robomaster_visualtag_gazebo/models/* ~/.gazebo/models/

Modify lidar model

$ roscd lms1xx/urdf

$ sudo vim sick_lms1xx.urdf.xacro

Delete <visual> tag (from line 42 to line 48).

Usage

Case1: Launch four robots navigation in a map.

$ roslaunch rm_simulator ridgeback_robots.launch

Case2: Launch one robot navigation in a map.

$ roslaunch rm_simulator one_rm_robot.launch

Case3: Only launch world

$ roslaunch rm_simulator arena.launch

Feel free to take a look at the launch files in rm_simulator pkg.

Config Robot Model

Add or remove camera and turret

if you want to add the camera and turret, modify the arg in the launch file:

<arg name="config" value="our_side" />

<arg name="config" value="enemy_side" />

else:

<arg name="config" value="our_side_no_camera" />

<arg name="config" value="enemy_side_no_camera" />

Func

Rotate the turret.

jackal0 is the robot ID, the unit of an angle is radian. Eg.

$ rostopic pub /jackal0/turret_position std_msgs/Float32 "data: 1.0"

Start new game by call this service.(Not use currently)

rosservice call /start_game "start: true"

Activate the debuff layer(Not use currently)

jackal0 is the robot ID. data's valid input is index from 1 to 6, the index 0 is not used. Eg.

rostopic pub /jackal0/debuff std_msgs/String "data: '0 1 1 0 1 1 1'"

TODO

  1. Run various Gazebo instances
  2. Add stage simulator.

Maintainers

@Yizheng.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Copyright and License

GPL-v3

robomaster-simulator's People

Contributors

hezip avatar imgbotapp avatar jhuizhu avatar lydiarong avatar privilger avatar zhuwangshu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

robomaster-simulator's Issues

File Missing: my_utility.py

Describe the bug
In line 12 of the file src/competition_rl/scripts/robo_instance.py, my_utility is imported but there is no python packages named my_utility nor python file named my_utility.py. I suspect that a file named my_utility.py is missing.

To Reproduce
Steps to reproduce the behavior:
Run the following command

roslaunch competition_rl start_training.launch

Expected behavior
Run normally without error

Desktop (please complete the following information):

  • Ubuntu Version: Ubuntu 18.04
  • ROS Version: melodic

[ERROR] [1636805101.138944786]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found

Thanks for your great work!
I ran the command roslaunch rm_simulator ridgeback_robots.launch following the instructions in README and ran into the above error with ROS version being Neotic. However, earlier I did almost the same thing on Melodic and no error occurs. As I am new to ROS and gazebo, could you please provide some help on how to resolve this issue?

Expected Outcome:
No error, four robots appear on the map.

Ubuntu version: 20.04
ROS version: Noetic

Error trace:

... logging to /home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/roslaunch-jakeluo-labpc-105471.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://jakeluo-labpc:37863/
......
etting /run_id to eca6f67e-4479-11ec-9874-0f9a2375c8c2
process[rosout-1]: started with pid [105501]
started core service [/rosout]
process[gazebo-2]: started with pid [105508]
process[gazebo_gui-3]: started with pid [105512]
process[map_server-4]: started with pid [105518]
process[jackal0/urdf_spawner-5]: started with pid [105519]
process[jackal0/robot_state_publisher-6]: started with pid [105520]
process[jackal0/controller_spawner-7]: started with pid [105521]
process[jackal0/ekf_localization-8]: started with pid [105522]
process[jackal0/cmd_vel_relay-9]: started with pid [105523]
process[jackal0/turret_controller-10]: started with pid [105525]
process[jackal0/global_planner_node-11]: started with pid [105539]
process[jackal0/local_planner_node-12]: started with pid [105543]
process[jackal0/behavior_test_node-13]: started with pid [105546]
[ERROR] [1636805100.934693031]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
......
process[jackal3/localization_node-44]: started with pid [105702]
process[simulate_refer_system-45]: started with pid [105705]
process[ridgeback_viz_jackal0-46]: started with pid [105709]
[ INFO] [1636805101.127980623]: !!!!!!!!!!!decision jackal_ns:jackal2
[ INFO] [1636805101.131774334]: !!!!!!!!!!!global jackal_ns:jackal0
[ INFO] [1636805101.131806940]: !!!!!!!!!!!jackal_number:0
[ERROR] [1636805101.138944786]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
......
[ INFO] [1636805101.148674883]: !!!!!!!!!!!decision jackal_ns:jackal3
[ INFO] [1636805101.158665933]: Load prototxt: /home/decision/decision/workspace/RoboMaster-Simulator/src/RoboRTS/roborts_planning/global_planner/config/global_planner_config.prototxt
[ INFO] [1636805101.182189451]: local planner start
[ERROR] [1636805101.199338900]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
[ INFO] [1636805101.232287005]: Load prototxt: /home/decision/decision/workspace/RoboMaster-Simulator/src/RoboRTS/roborts_planning/local_planner/config/local_planner.prototxt
[ INFO] [1636805101.250654186]: local planner start
[ INFO] [1636805101.254549442]: Load prototxt: /home/decision/decision/workspace/RoboMaster-Simulator/src/RoboRTS/roborts_planning/global_planner/config/global_planner_config.prototxt
[ERROR] [1636805101.259904003]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
......
[ INFO] [1636805101.421957796]: waitForService: Service [/static_map] has not been advertised, waiting...
[ INFO] [1636805101.430659859]: waitForService: Service [/static_map] has not been advertised, waiting...
[ INFO] [1636805101.432417707]: waitForService: Service [/static_map] has not been advertised, waiting...
[jackal0/robot_state_publisher-6] process has died [pid 105520, exit code 1, cmd /opt/ros/noetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal0-robot_state_publisher-6.log].
log file: /home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal0-robot_state_publisher-6*.log
[jackal1/robot_state_publisher-16] process has died [pid 105564, exit code 1, cmd /opt/ros/noetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal1-robot_state_publisher-16.log].
log file: /home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal1-robot_state_publisher-16*.log
[ INFO] [1636805101.483923939]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1636805101.484642078]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1636805101.565834622]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1636805101.566584950]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[jackal2/robot_state_publisher-26] process has died [pid 105616, exit code 1, cmd /opt/ros/noetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal2-robot_state_publisher-26.log].
log file: /home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal2-robot_state_publisher-26*.log
[jackal3/robot_state_publisher-36] process has died [pid 105652, exit code 1, cmd /opt/ros/noetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal3-robot_state_publisher-36.log].
log file: /home/decision/.ros/log/eca6f67e-4479-11ec-9874-0f9a2375c8c2/jackal3-robot_state_publisher-36*.log
[ERROR] [1636805102.826106674]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
[ERROR] [1636805102.827634362]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
[ERROR] [1636805102.831515666]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
[ERROR] [1636805102.832738008]: Failed to build tree: child link [front_camera] of joint [front_camera_bracket_joint] not found
[ INFO] [1636805103.064505345]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1636805103.077927275, 5775.864000000]: Physics dynamic reconfigure ready.
Error [parser_urdf.cc:3183] Unable to call parseURDF on robot model
Error [parser.cc:488] parse as old deprecated model file failed.

报错询问

好的,是这样,我按照readme的步骤安装,执行sudo sh install_flycapture.sh,安装过程中有一步要求我输入添加的用户名,我输入的是我的Ubuntu18.04的用户名sunshihao,安装结束后运行catkin_make,结果报错如下:

make[2]: *** 没有规则可制作目标“/home/sunshihao/RoboMaster-Simulator/devel/lib/libflycapture.so.2”,由“/home/sunshihao/RoboMaster-Simulator/devel/lib/libPointGreyCamera.so” 需求。 停止。
CMakeFiles/Makefile2:16278: recipe for target 'pointgrey_camera_driver/pointgrey_camera_driver/CMakeFiles/PointGreyCamera.dir/all' failed
make[1]: *** [pointgrey_camera_driver/pointgrey_camera_driver/CMakeFiles/PointGreyCamera.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....

Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

继续询问

我直接运行rosrun roborts_decision behavior_test_node
显示如下:
[ INFO] [1619767388.713756601]: !!!!!!!!!!!decision jackal_ns:
我输入jackal0、jackal_0都不对

编译报错询问

In file included from /home/sunshihao/RoboMaster-Simulator/src/pointgrey_camera_driver/pointgrey_camera_driver/src/PointGreyCamera.cpp:32:0:
/home/sunshihao/RoboMaster-Simulator/src/pointgrey_camera_driver/pointgrey_camera_driver/include/pointgrey_camera_driver/PointGreyCamera.h:46:10: fatal error: flycapture/FlyCapture2.h: 没有那个文件或目录
#include "flycapture/FlyCapture2.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~
你好,我在编译你的RoboMaster-Simulator包时显示你缺少这个头文件,请问是你忘记上传了吗?还是我这边出什么问题了,希望你能抽出时间尽快回复一下,十分感谢。

疑问

你好,我收到了你的回复,但是里面没有任何内容,不知道什么情况,我再次把问题描述一下,希望得到你的回复
你好,我已经能够成功运行你的仿真环境了,我想问一下这个环境中能不能不用Rviz中的箭头控制运动,而是直接用正式比赛的代码进行仿真,比如官方的运行历程:
步骤2:执行简单的决策
1、运行机器人驱动sdk、激光雷达、静态TF广播以及定位与规划功能模块

roslaunch roborts_bringup roborts.launch

2、运行决策测试节点

rosrun roborts_decision behavior_test_node

输入1\2\3\4\5\6来切换不同行为
如果可以的话,具体操作步骤是什么?
非常感谢你之前的耐心解答。

install

Can you provide a complete download procedure? I installed flycapture according to readme, but it can't go on after that. Can you provide a silly tutorial? Thank you

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.