Home        Store        Docs        Blog

Simulating Manual Control using Mavros

(Patrick José Pereira) #61

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:

(Juan Cely) #62

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!


(Juan Cely) #63

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!

(barain) #64

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://
  • 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.

(Patrick José Pereira) #65

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

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

(barain) #66

Thanks for help and guidance @patrickelectric. Its now working

Kind regards