mavros + ArduCopter SITL

845 views
Skip to first unread message

Clay McClure

unread,
Feb 24, 2015, 9:58:09 AM2/24/15
to drones-...@googlegroups.com
Howdy,

I'm attempting to use mavros with the ArduCopter 3.3-dev SITL and am running into an oddity. The SITL starts up fine, but when I connect mavros to a TCP "serial" port, the autopilot begins oscillating between armed/disarmed states and prints "Time has wrapped" on the console. Here's how I'm starting mavros:

roslaunch mavros px4.launch fcu_url:=tcp://localhost:5762

and here are the AC console messages:

Time has wrapped
Time has wrapped
Time has wrapped
Time has wrapped
online system 1 component 240
ARMED
Mode Mode(0x000000c0)
Time has wrapped
online system 1 component 1
DISARMED
Time has wrapped
Time has wrapped
Mode STABILIZE
Time has wrapped
Time has wrapped
online system 1 component 240
ARMED
Mode Mode(0x000000c0)
Time has wrapped
online system 1 component 1
DISARMED
Time has wrapped
Time has wrapped
Mode STABILIZE
Time has wrapped
Time has wrapped

I'm curious if anyone has seen this before I dive deeper to try to figure it out.

Thanks!

Clay

Vladimir Ermakov

unread,
Feb 25, 2015, 8:23:03 AM2/25/15
to drones-...@googlegroups.com
Hi,

Usual SITL will start mavproxy, so try connect to UDP (`fcu_url:=udp://@` should work).
Also you should use `apm.launch` for all APM based FCU's, `px4.launch` is for PX4 native stack.

вторник, 24 февраля 2015 г., 17:58:09 UTC+3 пользователь Clay McClure написал:

Clay McClure

unread,
Feb 25, 2015, 2:41:45 PM2/25/15
to drones-...@googlegroups.com
Thanks Vladimir, I appreciate your help.

Using apm2.launch worked. My confusion with which launch file to use was two-fold:
  • APM is both a hardware platform and a software stack; it wasn't clear to me whether "apm2.launch" was somehow specific to the APM 2.x series boards
  • I'm running ArduCopter-3.3x, which runs atop PX4 on a PX4 board (Pixhawk), so "px4.launch" seemed like a better choice than the ancient-sounding "apm2"
So thanks for the clarification, and thanks for merging in the pull request to update the docs!

As for TCP vs UDP connection, I figured that connecting to a virtual (TCP) serial port would more closely simulate the final "production" environment, where I'll be connecting the companion computer to one of the Pixhawk's telemetry UARTs. But at your suggestion, I tried using MAVProxy's UDP proxy, and found the proper incantation to be:

roslaunch mavros apm2.launch fcu_url:=udp://localhost:14551@

That's because, by default, the sim_vehicle.sh script tells MAVProxy to forward to 14550 and 14551, and APMPlanner likes to listen on 14550, leaving 14551 available for mavros.

Thanks again,

Clay
Reply all
Reply to author
Forward
0 new messages