Trouble getting started with ROS control

Hi there!

After a very good experience with BlueROV2 controlled via QGroundControl, I’m trying to start controlling the robot with the ROS software. All the initial stages are done, compilation, dependencies, network setup, etc.

First question. On a ROV set up for QGroundControl, there are mavproxy.py and the camera acquisition/streaming chain running. Do both of them have to be stopped in order to use the ROV with ROS?

Secondly: I run launch bluerov_r1.launch on the ROV and launch rviz.launch + launch teleop_xbox.launch + rosrun qt_view_image on the control PC. No errors are displayed and everything seems to be neatly connected. But when I make control input, nothing happens. The camera streams OK and I can see the coordinates move in rviz when I move the ROV.

I tried pushing the arming button and calling the /mavros/cmd/arming service with “value: true” (with bad results, normally). Nothing seems to let me control the ROV or even the camera tilt.

What can I be missing? I cannot find any document or post that explains either the role of all ROS bluerov nodes and services (they are far from self explanatory without digging in the code) or the launch sequence and prerequisites, so I’m a little in the darkness here…

Otherwise, I’m glad to see such a vibrant community around this project and wish you all good time tinkering :slight_smile:

It’s been more than a year since I have used ROS with ArduSub, and ArduSub has changed a lot since then. The bluerov ROS packages have not been maintained in the meantime, but they should still work.

The bluerov ROS packages were originally designed for the BlueROV1 developer package, before ArduSub had been conceived and eventually matured. You could probably use the BlueROV with mavros only, although the advantage of the bluerov packages may be the teleop_joy implementation to add joystick support. I’m not sure if mavros supports this on it’s own.

Have you made any progress? If you are still having trouble with this, I recommend visiting the mavros gitter channel for help. Let them know that you are using ArduSub, because they will likely assume you are using ArduCopter otherwise.

Another note, if you don’t have a specific need for using ROS with the ROV, MAVProxy is a great developer tool written in python, that is a lot easer to install, set up and use (in my opinion) than ROS.

Hi Jacob,

Thank you for your reply! Unfortunately, I made little progress in terms of results but I’m starting to understand the system a little bit better. I will stick to the ROS package, because I’m interested in using ROS tools and packages to develop the control further, once I get over the basics, of course :wink:

First of all, I guess that the major difference between the BlueROV1 and 2 in terms of control is the autopilot board, right?

For use with QGroundControl, we flashed the Pixhawk controller with the PX4 stack. I’m beginning to think that perhaps to use the ROS control package, I might need to reflash the controller with the APM package. I’m really a beginner in this, so I don’t fully understand the relation between the ArduSub and the controller stacks, but at least you could perhaps confirm that I’m on the right track. I think that our installation followed these instructions: http://ardusub.com/raspi-setup/#flashing-pixhawk-through-ssh

Otherwise, could you please confirm what is the correct procedure for launching control with the ROS package? Apart of launching the *.launch files that I listed in my first post, what are the operations that I have to carry out in order to get control of the ROV? Is there any other command that I have to issue by hand or push buttons or call services? I would be obliged if you point me in the right direction, as I haven’t found the right info yet.

Hi Jacob and Szymon,

I’m working on the same problem. I have experience with ROS (but not with MAVROS nor MAVLINK).

At this moment, mavros (with udp) makes possible to acquire all data from the BlueROV2 (sensors, battery and status). However, no success was achieved for controlling the vehicle: rc/override, velocity or attitude control.

For your reference, I have tried the teleop from the “bluerov-ros-pkg” and the “mavros”. The node from the bluerov-ros makes possible to “arm/disarm” and to change between states “Landing and Taking off”. However, the joystick does not work in “Manual” (rc/override) - the motors remain stand still.

Any ideas why it is not possible to control the ROV using the joystick in ROS (in a similar way as in the QGC)?

PS. I’m using ROS-Indigo version and so, the MAVROS is a little outdated - this could be the reason ? (the MAV_TYPE of the PX4 is currently setup as Fixed Wing which is a little strange…).

Thnks =)
Haar

First of all, I guess that the major difference between the BlueROV1 and 2 in terms of control is the autopilot board, right?

The BlueROV1 was sold as a developer kit, it was just the ROV frame and thrusters, the electronics and software were all up to the user.

For use with QGroundControl, we flashed the Pixhawk controller with the PX4 stack. I’m beginning to think that perhaps to use the ROS control package, I might need to reflash the controller with the APM package. I’m really a beginner in this, so I don’t fully understand the relation between the ArduSub and the controller stacks

There are two mainstream flight stacks used on the Pixhawk: These are PX4 and APM. The difference is that they are two separate pieces of software, both designed to accomplish the same (in general) thing. It’s kind of like the difference between Internet Explorer and Firefox, they’re two different applications that do the same thing, and both will run on Windows Operating Systems.

Both PX4 and APM support different vehicle types and frames, but only APM has support for ROVs. This is ArduSub, aka APM: Sub. In the APM flight stack, using different vehicles requires you to load different firmware files on the Pixhawk. You will need to flash the Pixhawk with the ArduSub-specific APM firmware file found here (BlueROV2 frame firmware, firmware files are sometimes further separated according to the different supported frames for a specific vehicle).

Otherwise, could you please confirm what is the correct procedure for launching control with the ROS package? Apart of launching the *.launch files that I listed in my first post, what are the operations that I have to carry out in order to get control of the ROV? Is there any other command that I have to issue by hand or push buttons or call services? I would be obliged if you point me in the right direction, as I haven’t found the right info yet.

I think that the .launch files do not need to be launched in any particular order. It should work once everything has been launched, but ArduSub has been incompatible with the bluerobotics ROS package for some time.

As I mentioned, it has been a long time since I have used ROS, and the ArduSub firmware has undergone a LOT of changes since we have maintained the ROS packages. Features like the joystick button actions, camera tilt, and lights were not even in ArduSub at the time. The ROS package at the time was provided as a bare-bones example of the api, with the expectation that people interested in using ROS would be able to develop on top of this. We have moved away from the use of ROS, as it was overly complex for the majority of our customers. We do not have the resources to maintain the ROS packages at this moment, but I would be happy to review any pull requests you might want to make after working with the packages.

At this moment, mavros (with udp) makes possible to acquire all data from the BlueROV2 (sensors, battery and status). However, no success was achieved for controlling the vehicle: rc/override, velocity or attitude control.

RC_CHANNELS_OVERRIDE should work, however there was one bug (recently fixed in master) in ArduSub that prevented the camera tilt function from working while sending RC_CHANNELS_OVERRIDE messages. Another thing you might want to try is sending MANUAL_CONTROL messages.

Velocity and attitude control MAV_CMD messages have just recently been implemented, and require and external positioning system to work.

For your reference, I have tried the teleop from the “bluerov-ros-pkg” and the “mavros”. The node from the bluerov-ros makes possible to “arm/disarm” and to change between states “Landing and Taking off”. However, the joystick does not work in “Manual” (rc/override) - the motors remain stand still.

PS. I’m using ROS-Indigo version and so, the MAVROS is a little outdated - this could be the reason ? (the MAV_TYPE of the PX4 is currently setup as Fixed Wing which is a little strange…).

The bluerobotics ROS packages were developed on Indigo, so that should not be a problem. The mavros package may have been updated since indigo. It sounds like you have the PX4 firmware running on your Pixhawk. Try uploading the ArduSub firmware.

Any ideas why it is not possible to control the ROV using the joystick in ROS (in a similar way as in the QGC)?

This should be working. The major difference is that the ros package sends RC_CHANNELS_OVERRIDE, and QGC sends MANUAL_CONTROL to the vehicle.

Thank you for your hints, Jacob. I think that with a little bit of experience with the ROS components used in the bluerov(_apps) packages, it is possible to “fix” the code so that they work with BlueROV 2.

According to what I have gathered, most of this fix will be done by modifications to the teleoperation nodes which decide which values are sent over which channels. Do you agree? I guess this is the interface that changed with the evolutions of ArduSub. I’m not yet sure if any changes will be necessary to the MAVROS configuration -please let me know if you have a better vision of where the modifications have to be made.

Yes, it would be best to convert the package to use MANUAL_CONTROL instead of RC_CHANNELS_OVERRIDE.