[solved] Trigger camera via MAVROS

Hello,
I use a Pixhawk with Arducopter 3.3 and I want to trigger the camera with mavros.
I try with
rosservice call /mavros/cmd/trigger_control 1 0
but it answer :
success: False
result: 3
And nothing in mavros terminal:
The link is working as when I call :
rosrun mavros mavsafety arm
In terminal:
Request failed. Check mavros logs
And in mavros terminal:
[ERROR] [1476375492.460409636]: FCU: PreArm: inconsistent compasses

Is /mavros/cmd/trigger_control supposed to work with ArduCopter or only with PX4 firmware ?
How to trigger camera via mavros ? With RC_Override ?

Thanks for your help

The service /mavros/cmd/trigger_control use MAV_CMD_DO_TRIGGER_CONTROL (2003), but Arducopter use MAVLink message 203, DO_DIGICAM_CONTROL.
Trying with:
rosservice call /mavros/cmd/command 1 203 0 0 0 0 0 1 0 0

success: True
result: 0
ros log [ WARN] [1476455456.543873868]: CMD: Unexpected command 203, result 3

3 mean MAV_RESULT_UNSUPPORTED : Command UNKNOWN/UNSUPPORTED
EDIT : Or it is MAV_CMD_ACK_ERR_ACCESS_DENIED = 3

But 203 is what Mission Planner use for triggering:
MainV2.comPort.doCommand(MAV_CMD.DO_DIGICAM_CONTROL, 0, 0, 0, 0, 1, 0, 0);
How to forge the same message with mavros ?
With mavproxy, “cammsg” return me the same error.

Hi,
I just test in copter3.4 and both mavros and mavproxy commands that you used are working. Normally, it should be supported in copter 3.3. I don’t have pixhawk to test right now . I will give a try on monday on a pixhawk with copter 3.3

Thank you, so it is not an arducopter problem, nor mavros or mavproxy.

I think I’m just missing something, like setting SYSID_MYGCS.
I’ve tried 1 and 255 but same error.
Maybe I’ve missed something else ?

I have updated MAVProxy with: sudo pip install -U pymavlink MAVProxy

Using Mission Planner and click on “Trigger camera Now” work. => So it is not a config problem on Pixhawk side, right ?
Using mavproxy in SITL mode it works.
:disappointed:

Their is a major difference between your config and sitl : you are on copter 3.3 and sitl is 3.4 . I will test monday on real pixhawk . But it is strange that is works with mission planner and not with other. I will test and get back to you ok ?

Hello,
I tried on two others computers and the behaviour is the same.
Probably a software version mismatch… all 3 computers where using:

  • Ubuntu 14.04
  • ROS indigo
  • Mavros from ros-indigo package (maybe that’s the problem ?)

After doing a “sudo pip install -U pymavlink MAVProxy” I don’t see the error message in mavproxy but nothing seems to work (not able to change mode for example)
Still the same error in mavros.
I will try to build mavros from source and maybe also 3.4. Is it safe to fly with it ?

EDIT following https://github.com/mavlink/mavros/blob/master/mavros/README.md#installation I got an error:

error: pathspec ‘2016.10.10’ did not match any file(s) known to git.
In “git tag” I have a "upstream/2016.10.10"
Same error on 16.04 with Kinetics

EDIT2:
I tried on 16.04 with Kinetics:

sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
roslaunch mavros apm.launch fcu_url:=/dev/ttyUSB0:57600 _gcs_url:=‘udp://:14555@localhost:14550’
$ rosservice call /mavros/cmd/command 1 203 0 0 0 0 0 1 0 0
success: True
result: 0
CMD: Unexpected command 203, result 3

(Still Arducopter 3.3.3)
Copter is not armed and arming check failed but with RC the camera trigger. With MP also.

Hi, just try on copter 3.3 with mavros ,and it failed… on lastest copter beta, no problem.

1 Like

Well done, I’ve loaded “V3.4-rc6” on-board and it works !