Simulating Manual Control using Mavros

Hello Juan,

I’m glad that my comments were useful for you.

I can see from the state topic that the vehicle is armed in manual mode, are you able to control this ROV via QGroundControl ?
You’ll not be able to control the motors individually with rc/override, take a look about it here:

Hi Patrick, Yes, i can move motors using the interface to test and using a joystick. About the topics named Bluerobotic, Is it necesary to install any package more? When I send info using rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1600, 1500, 1500, 1500, 1500, 1500, 1500, 1500]" -r 10 I got nothing, without the -r 10 at end I receive publishing and latching message. Press ctrl-C to terminate I am sure the PX4 config is ok, maybe I can use bad the connections. Please anyone who can explain me please. Sorry!

Thanks!

Hi everyone!!!

I’m glad, after a lot of things the ROV is working! The solution was a stupid. We have had the SYSID MYGCS bad all time. The default value is 255 or 240, the correct value is 1, for my case.

If anyone has doubts, the corrects steps are the follow:

  1. Launching, please verify the port and baudrate:

roslaunch mavros apm.launch

  1. Setting the stream rate, in my case 10 Hz is OK.

rosservice call /mavros/set_stream_rate 0 10 1

  1. Arming the ROV

rosservice call /mavros/cmd/arming "value: true"

  1. In my case, I was sure and was writting the cero value. I have just 4 motors. ATENTION: I compiled a version of Ardusub with a specific frame. If it is your case modify the frame parameter for custom in QGC.

rostopic pub -r 20 /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1500, 0, 0, 0, 0]"

  1. If you set another velocity for each motor you can send specific value according to the max to min parameters. For example: I want to move the 2nd motor, I use:

rostopic pub -r 20 /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1750, 1500, 1500, 0, 0, 0, 0]"

Finally, I can say, I solved my problem!

Thanks a lot to @jwalser and @patrickelectric for your help!

3 Likes

Hi Guys
I am trying to use QGC/MavROS on the same machine to perform SITL testing. The following works fine as suggested by @patrickelectric in this post

  • Start SITL
    cd ardupilot/ArduSub
    sim_vehicle.py -j4
  • Connect mavros with SITL
    roslaunch mavros apm.launch fcu_url:=udp://0.0.0.0:14550@
  • Arm the ROV and put it on guided mode.
    rosrun mavros mavsafety arm
    rosrun mavros mavsys mode -c GUIDED

How we can talk to QGC for visualization? The port 14550 is the default port for QGC? I have tried to change and add the gcs_url with different port but no luck. It seems like @juanscelyg is using the serial port connected to FCU.
I will appreciate your guidance and help. Thanks.

Yes, 14550 is default for both mavros and QGC. You can add more udp endpoints with --out=udp:0.0.0.0:14550 --out=udp:0.0.0.0:14666 --out=type:ip:port...when running SITL.
This is how I usually run SITL:
sim_vehicle.py -m --mav20 -j5 -L RATBeach --out=udp:0.0.0.0:14550 --out=udp:0.0.0.0:14666

note: sim_vehicle.py --help #is your friend :slight_smile:

2 Likes

Thanks for help and guidance @patrickelectric. Its now working

Kind regards

1 Like

Thank you to Juan saying that you need to change SYSID_MYGCS to 1 in QGC. This resolved our bug with the RC override publishing not working.

This is a question that I have already asked in another forum. But I am modifying it here to know some new insights to the problem at hand.
@patrickelectric @jwalser
I am trying out a boat for a competition. I am familiar with ArduSub a bit by using BlueROV. I have been trying to learn a bit on Mavros and ROS in general and have followed tutorials on the Ardupilot website.

The boat I am trying to Configure has the following specs:

  1. Pixhawk Controller running ArduSub
  2. 4 Thrusters from BlueRobotics. Hoping to use BlueROV2 vectored Configuration with middle two thrusters disabled using Custom firmware or not connecting ESCs.
  3. GPS
  4. Realsense Camera (D435) to detect obstacles
  5. Jetson Nano.

I had previously tried motors using RC_Channel_override commands on ArduSub and I feel it works. But after learning ROS, I have a few questions that I hope you should be able to answer. My questions can be foolish as I am starting out.

  1. In Guided Mode Navigation, can the boat resist water current and wind and reach a certain point? Is Stabilisation or position hold working in that mode?

  2. In the competition, I want to go to location based on Buoys, which I feel can be tagged by going around the circuit and noting the point of interest. If I do this, can the MAVROS setup give me the ability to navigate through waypoints?

  3. If I am using RC_channel_override and writing my own Stabilisation and Position hold algorithm, can I still use ROS features of Navigation because I am not using the command to send velocity.? I feel it will not work. But asking here to get your suggestion.

Hoping to hear from you soon.

Hi,

I would recommend to use ArduRover over ArduSub for boats, ArduRover officially supports boats and supports vectored thrusters:
https://ardupilot.org/rover/docs/boat-configuration.html
I also believe that it covers all points that you are asking.

About the ROS questions, you can do everything that you are asking via ROS or pure MAVLink, for the second, you can create a middleware that process the realsense data and provide an OBSTACLE_DISTANCE message.

1 Like

Im trying to simulate a bluerov in Gazebo using SITL. I want to control it using the mavros topics. I tried the following procedure and it successfully connects and arms. However, the bluerov starts sinking and is not responsive to the commands published on the mavros topics. Any suggestions how to solve this?

Hey,

If you are interested in using ROS2 + Ignition + MAVROS2 to simulate the bluerov, check this repo for an example: GitHub - remaro-network/tudelft_hackathon: REMARO Summer School Delft 2022 - Underwater robotics hackathon

Hello everyone, I have encountered a problem where I am trying to control my PX4 using Simulink. I am using a Jetson TX2 with a Pixhawk to control my vehicle. The motors that I am connecting to are the main out 2 and main out 4. I am attempting to control the vehicle using “/mavros/manual_control/send”, and I can see that my values are being received in the topic after publishing. However, the vehicle is not responding to the commands.
1

Hi @Daven, welcome to the forum :slight_smile:

Is your vehicle armed? The autopilot will not allow the motors to engage if the vehicle is not armed.

1 Like

have used the “call service” block in Simulink to transmit signals for arming or disarming, and it was successful in arming.
However, when I use the “/mavros/manual_control/send” block in Simulink to transmit signals, it can publish correctly in the topic, but my px4 does not respond.

@Daven did you end up resolving this?

I’m clearing through a backlog at the moment and found that I forgot to send this response:

I haven’t used MAVROS or Simulink to control an ROV before, but my main thoughts here are that

Yes, I have successfully executed it.

Thank you for your help.

1 Like