Git Product home page Git Product logo

bluerov_ros_playground's Introduction

BlueRov-ROS-playground

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 Commputer   |
                      |    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

jaxxzer avatar patrickelectric 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bluerov_ros_playground's Issues

ImportError: cannot import name 'Bridge' from 'bridge'

Hello Patrick,

I tried installing your simulator for BlueROV2. The whole process took me a while because I'm new to ROS.

When everything was installed and running I tried to access the BlueROV nodes via the following command:

roslaunch bluerov_ros_playground bluerov2_node.launch

Unfortunately, I got the following error:
Screenshot from 2024-03-01 19-11-32

I google it and tried a few things but I cannot make it work. I would appreciate your help.

Thanks in advance!

ImportError: No module named bluerov.video

When doing
roslaunch bluerov_ros_playground video.launch,
The following error appears:

Traceback (most recent call last):
File "/catkin_ws/src/bluerov_ros_playground/src/bluerov/bin/video", line 3, in
import bluerov.video as Video
ImportError: No module named bluerov.video

However, I checked that the imported modules are in its place, and they are. I'm not sure if it is a problem of mine or maybe the import is done wrong.

Add light in BlueRov2

Light in robots appear to be possible since the beginning of this year with gazebo7.
The PR that add this functionality can be seen here.
It was not possible to add the lights in the actual model, need more research to solve this problem.
It appear that the light need to be declared in to be used in , but this is only a speculation.

Sub instantly sinks on starting in Gazebo

Hi,

I'm running ubuntu18 for this. When I launch the sub through roslaunch, the sub instantly sinks, and keeps sinking. No commands I publish to mavros seem to work. What should I do?

xacro ERROR

Hello, I have a problem and I hope you can help me with the command roslaunch bluerov_ros_playground rviz.launch I get the following error:

Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '--inorder', '/catkin_ws/src/bluerov_ros_playground-master/model/BlueRov2.urdf.xacro']].

I am using NOETIC and ubuntu 20, I don't know if this is a problem, thank you very much.

The image from topic "/camera/image_raw" is caton

Hi,when i run the ros_node to view image,i found the image from topic "/camera/image_raw" is caton.And there is high picture delay when the bluerov move.So that i can't use the image to run the orbslam2.Could you please give me some advice?Thank you!

No underwater video and ROV can not move by joystick in GAZEBO

Hi~
I'm using this package to run open-source SLAM algorithms but I haven't got any underwater video except mosaics on the /image_raw window, the ROV can not move by joystick in GAZEBO either, and after I click the "play" button on GAZEBO GUI, the ROV disappears soon ...

My system env:

~ Ubuntu 16.04 64bit + ROS-Kinetic
~ 16G RAM+i5 4210U+ integrated graphics chip + xbox360 joystick (test ok)

My cmd lines:

  1. run bluerov node:
    $ roslaunch bluerov_ros_playground bluerov2_node.launch bluerov_node_device:=udp:localhost:14550
  2. Visualize video stream:
    $ roslaunch bluerov_ros_playground video.launch
    3.Run SITL and start gazebo.launch:
    $ cd ardupilot/ArsuSub
    $ sim_vehicle.py
    $ gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
    $ roslaunch bluerov_ros_playground gazebo_teleop.launch

The README.md confuses me and I would be appreciated if you can help.

RC Override data array full: how to add more motor control via joystick?

I am attempting to control an ROV with mavROS. I have Ardusub code running on a Pixhawk 4. On the topside I am running mavROS to facilitate camera input amongst other sensor streams and provide the ROS specific implementation of Mavlink. I am publishing messages to mavROS topics using an XBox controller.

My startup command in terminal is:

'roslaunch bluerov_ros_playground user_mav.launch'

I am getting perfect control of my 8 existing ROV thrusters using the 2 joysticks on the XBox controller. What I would like to do is add 2 more thrusters that only need stepwise speed control via 2 buttons on the controller (RB and RT). The commands would simply be step up speed in a clockwise direction on both thrusters or step up speed in the anticlockwise direction on both thrusters.

In 'src/bluerov/user.py', the commands for the 8 existing thrusters are sent to the Pixhawk via the ROS topic 'RCOverrideIn'. This data array for this topic is full however. How do I create an equivalent topic on which to publish the commands for my additional 2 thrusters?

I have tried adding in code like:

            if buttons[5] == 1: # Both Additional Motors Speed Up Clockwise
                thrust = [0.5] # THIS IS AN ARBITRARY VALUE BETWEEN 0 and 1 for now
                self.pub.set_data('/mavros/setpoint_attitude/thrust', thrust)

but I am not sure if the Thrust topic is the ideal one to be using.

Any help much appreciated! Also I am new to ROS, apologies for the noob questions in advance.

Topic: /BlueRov2/servo1/set_pwm etc can not be found.

Dear patrick:
roslaunch bluerov_ros_playground bluerov2_node.launch bluerov_node_device:=udp:192.168.2.1:14550
roslaunch bluerov_ros_playground control.launch bluerov_node_device:=udp:192.168.2.1:14550
The above two instructions are executed, these topics that /BlueRov2/servo1/set_pwm, /BlueRov2/servo2/set_pwm, /BlueRov2/servo3/set_pwm, /BlueRov2/servo4/set_pwm, /BlueRov2/servo5/set_pwm, /BlueRov2/servo6/set_pwm, /BlueRov2/servo7/set_pwm and /BlueRov2/servo8/set_pwm can not be found by the commander that rostopic list.
Thank you very much!
Best wishes to you!

Empty topics with bluerov_node

When launching the bluerov2 node by doing:
roslaunch bluerov_ros_playground bluerov2_node.launch(there's a mistake in the README, where bluerov_node is called)

The following text appears in the console:

no BATTERY_STATUS data
no HEARTBEAT data
no SCALED_IMUX data
no LOCAL_POSITION_NED data
no SCALED_IMUX data
no LOCAL_POSITION_NED data

After that, I echoed the topics /BlueRov2/battery, /BlueRov2/imu/data, and odometry, and nothing happens. Maybe they aren't supposed to publish anything?
However, the image and state topics are publishing the topics well.

On the other hand, when launching
roslaunch bluerov_ros_playground user_mav.launch
the imu data is correctly displayed in the topic /mavros/imu/data (with a very high error in the Z axis, though).

Initial position on complete vanilla setup and some installation issues.

Hello,
I had to reinstall the ROS packages and dependencies for ROS (ros noetic) on a new virtual machine and run into unforseen issues compared to the previous build (around january 2024). The build is exactly as the instructions says in the bluerov_ros_playground README. Nothing more has been added.

First of all, Mavros_extras had troubles getting built but I did a workaround to solve the compiling problem.
The issue was GPS2_RAW finding undefined mav_msgs in in /mavros_extras/src/plugins/gps_status.cpp and the solution was to comment out everything containing GPS2_RAW.

Second of all, I wanted to recall that upon launching the gazebo or the gazebo teleop, the BlueROV2 floats on top of the water.
In my case, it plummets.

Is there anyone that has this issue during an install and have solved it?
If yes, how did you do it.

Add gazebo-bluerov2 in ardupilot

It appears that libArduPilotPlugin.so and libArduCopterPlugin.so do ardupilot-gazebo bridge,
the first one is a new concept done by @khancyr, the second is an old plugin that apparently will not interact with underwater vehicles.

How can i get the message for ROS topic "camera_info"??

Hi,recently,i am using the bluerov2.I want to run the orbslam2 using the camera of the bluerov2. And,when i used the camera,i can not found the message for ROS topic "camera_info",so that the camera calibration work can not be done.Can you give me some advice to help me solve this problem? Thank you very much!

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.