Scripts to help BlueRov integration with ROS. What is possible ?
$ cd ros_workspace_path/src
$ git clone https://github.com/patrickelectric/bluerov_ros_playground
$ cd ../
$ catkin_make --pkg bluerov_ros_playground
$./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --pkg bluerov_ros_playground
$ source devel/setup.sh
$ source devel/setup.sh
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.
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
Run ArduPilot SITL
$ cd ardupilot/ArsuSub
$ sim_vehicle.py
$ 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
gst-launch-1.0 -v udpsrc port=5600 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false
If you need more information about the topics and what you can access, take a look here.
+-----------------------+ +------------------------+ | 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 +------------------------+