Giter Site home page Giter Site logo

bluerov_ros_playground's Introduction

BlueRov-ROS-playground

github original : (https://github.com/patrickelectric/bluerov_ros_playground)

See more documentation : https://acolor-bluerov2.gitbook.io/acolor-bluerov2/

Scripts to help BlueRov integration with ROS. What is possible ?

  • Video streaming capture with opencv
  • Read and write over mavlink protocol with MAVROS
  • Joystick interaction
  • Gazebo simulation

Getting Started

Requirements

Installation

  1. Go to your ROS package source directory:
    • $ cd ros_workspace_path/src
  2. Clone this project.
    • $ git clone https://github.com/patrickelectric/bluerov_ros_playground
  3. Go back to your ROS workspace:
    • $ cd ../
  4. Build and install it:
    • $ catkin_make --pkg bluerov_ros_playground
    • if using ROS from source:
      • $./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --pkg bluerov_ros_playground
  5. Reload your ROS env.
    • bash: $ source devel/setup.sh
    • zsh: $ source devel/setup.sh

Running

  • BlueRov2 node

    For more information check here.

  • Launch user example

    This example will start user example, reading data from mavlink, interacting with joystick over rc commands and showing ROV video stream.

    • roslaunch bluerov_ros_playground user_mav.launch

    To run QGC parallel with user_mav, it's necessary to run user_mav first. If it's necessary to change the input, the parameter joy_dev can be used to set the one used.

  • Visualize video stream

    Shows video stream using opencv and gstreamer

    • roslaunch bluerov_ros_playground video.launch

    To capture video stream in user_mav/video and QGC at same time, it's necessary to modifie gstreamer options, changing ! udpsink host=192.168.2.1 port=5600 to ! multiudpsink clients=192.168.2.1:5600,192.168.2.1:5601 and add the udp_port parameter when calling roslaunch (video_udp_port:=5601).

  • Gazebo

    This example allow SITL communication with Gazebo, right now the only interaction that happen is the thruster control using thruster pwm fitting.

    • Run SITL and start gazebo.launch
    • roslaunch bluerov_ros_playground gazebo.launch
  • Gazebo Teleop

    It'll open a window with the camera stream and Gazebo, a joystick can be used to control the ROV.

    • roslaunch bluerov_ros_playground gazebo_teleop.launch

    To change the default joystick input (/dev/input/js0), it's possible add the parameter joy_dev:=/dev/input/jsX when launching the simulation.

  • RVIZ

    Visualize 3D model

    • roslaunch bluerov_ros_playground rviz.launch

Running with SITL

  • Run ArduPilot SITL

    1. Download ArduPilot and configure SITL.
    2. $ cd ardupilot/ArsuSub
    3. $ sim_vehicle.py
    • To test mavros communication with SITL:
      • $ roslaunch mavros apm.launch fcu_url:=udp://0.0.0.0:14550@
  • Fake video stream

    • $ gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
      • If necessary, change video source and resolution.
      • To test the udp reception: gst-launch-1.0 -v udpsrc port=5600 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false

Topics

If you need more information about the topics and what you can access, take a look here.

Software Layer Diagram

                      +-----------------------+         +------------------------+
                      |     Raspberry Pi      |         |    Topside Computer   |
                      |    ip 192.168.2.2     |         |     ip 192.168.2.1     |
                      |                       |         |                        |
+-------+  Telemetry  | +-------------------+ |         |                        |
|Pixhawk<-------------->USB         MAVProxy| |         |                        |
+-------+    Pilot    | +                   + |         | +--------------------+ |
            Control   | |            udpbcast<----------->:14550         MAVROS| |
                      | +-------------------+ |  Pilot  | |(UDP)               | |
                      |                       | Control | |                    | |
                      | +-------------------+ |         | |       (ROS)        | |
+---------+           | CSI+2       raspivid| |         | +------+/mavros+-----+ |
|Raspberry+------------>camera              | |         |           ^            |
| Camera  |           | port                | |         |           |            |
+---------+           | +                   | |         | +---------v----------+ |
                      | |                   | |         | |subs.py      pubs.py| |
                      | +------------+stdout+ |         | |                    | |
                      |                  +    |         | |                    | |
                      |             Raw  |    |         | |                    | |
                      |             H264 |    |         | |                    | |
                      |                  v    |         | |      user.py       | |
                      | +------------+ fdsrc+ |         | |                    | |
                      | |gstreamer          | |         | |                    | |
                      | |                   + |         | :5600 video.py       | |
                      | |             udpsink+----------->(UDP)                | |
                      | +-------------------+ |  Video  | +---------^----------+ |
                      |                       | Stream  |           |            |
                      +-----------------------+         |           +            |
                                                        | +--------/joy--------+ |
                                                        | |joy     (ROS)       | |         +--------+
                                                        | |                  USB<----------+Joystick|
                                                        | +--------------------+ |  Pilot  +--------+
                                                        |                        | Control
                                                        +------------------------+

bluerov_ros_playground's People

Contributors

cyrilcotsaftis avatar nathanfourniol 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.