BOOM. From the Solo’s Shot Log file. This explains everything! Is the home location being stored differently on the pixhawk now compared to how it was in 3.3?
Mission Planner shows the correct home location because it’s getting it straight from the Pixhawk the way it always does. But the companion computer is having a hard time getting it. And that’s why the guided mode RTH and controller’s home distance isn’t working.
The Solo’s RTH/RTM uses the companion computer’s own routine via guided mode on the pixhawk. All the stuff it does in guided mode is logged in the “shot log” file. So even the RTH is “smart shot” that it logs. Looks like the companion computer is having a hard time obtaining the home location based on AttributeError: ‘NoneType’ object has no attribute 'lat’
The shows the most recent calls, to include which call bombed out. Upon not being able to obtain the home location, it gave up and kicked it back to loiter.
Mar 31 21:21:01 3dr_solo local2.info shot: [shot]: Entering shot Return Home.
Mar 31 21:21:01 3dr_solo local2.info shot: [RC] Enabling stick remapping
Mar 31 21:21:01 3dr_solo local2.info shot: [RTL] Try Guided
Mar 31 21:21:01 3dr_solo local2.info shot: [RC] detach from rc_ipc.put
Mar 31 21:21:01 3dr_solo local2.info shot: [RC] Disabling stick remapping
Mar 31 21:21:01 3dr_solo local2.info shot: Traceback (most recent call last):
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/shotManager.py", line 136, in Run
Mar 31 21:21:01 3dr_solo local2.info shot: self.buttonManager.parse()
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/buttonManager.py", line 105, in parse
Mar 31 21:21:01 3dr_solo local2.info shot: self.handleButtons((msg[1],msg[2]))
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/buttonManager.py", line 267, in handleButtons
Mar 31 21:21:01 3dr_solo local2.info shot: self.shotMgr.enterShot(shots.APP_SHOT_RTL)
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/shotManager.py", line 273, in enterShot
Mar 31 21:21:01 3dr_solo local2.info shot: self.curController = ShotFactory.get_shot_obj(shot, self.vehicle, self)
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/shotFactory.py", line 31, in get_shot_obj
Mar 31 21:21:01 3dr_solo local2.info shot: return shot_class(args[0], args[1])
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/returnHome.py", line 82, in __init__
Mar 31 21:21:01 3dr_solo local2.info shot: self.returnAlt = self.coneOfAwesomeness(self.returnAlt)
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/returnHome.py", line 152, in coneOfAwesomeness
Mar 31 21:21:01 3dr_solo local2.info shot: homeDistance = location_helpers.getDistanceFromPoints(self.vehicle.location.global_relative_frame, self.homeLocation)
Mar 31 21:21:01 3dr_solo local2.info shot: File "/usr/bin/location_helpers.py", line 16, in getDistanceFromPoints
Mar 31 21:21:01 3dr_solo local2.info shot: dlat = (loc2.lat - loc1.lat)
Mar 31 21:21:01 3dr_solo local2.info shot: AttributeError: 'NoneType' object has no attribute 'lat'
Mar 31 21:21:01 3dr_solo local2.info shot:
Mar 31 21:21:03 3dr_solo local2.info shot: +-+-+-+-+-+-+ Starting up v2.4.1-1 +-+-+-+-+-+-+
Mar 31 21:21:03 3dr_solo local2.info shot: [RC] Disabling stick remapping
Mar 31 21:21:03 3dr_solo local2.info shot: [app]: Ready for connections from app.
Mar 31 21:21:03 3dr_solo local2.info shot: [button]: Creating a new thread to connect to Artoo.
Mar 31 21:21:03 3dr_solo local2.info shot: [button]: read in button mappings
Mar 31 21:21:03 3dr_solo local2.info shot: [button]: Button A - shot FLY, mode Stabilize
Mar 31 21:21:03 3dr_solo local2.info shot: [button]: Button B - shot FLY, mode FLY: Manual
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: read enabled value from settings of 1.
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending gimbal enabled param (GMB_GP_CTRL) to 1.000000
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Inited GoProManager
Mar 31 21:21:03 3dr_solo local2.info shot: [RewindManager] Init
Mar 31 21:21:03 3dr_solo local2.info shot: [shot]: No gimbal detected.
Mar 31 21:21:03 3dr_solo local2.info shot: [shot]: Restart in air.
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Gopro status changed to 2
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Gopro recording status changed to 1
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending Gopro state to app
Mar 31 21:21:03 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:03 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 11
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 10
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Gopro get request for command 4 failed with status 1
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 9
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Gopro video resolution changed to 8
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: Gopro video frame rate changed to 4
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending Gopro state to app
Mar 31 21:21:03 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:03 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 8
Mar 31 21:21:03 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 7
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro photo resolution changed to 4
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending Gopro state to app
Mar 31 21:21:04 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:04 3dr_solo local2.info shot: [app]: Can't send packet - app is not connected!
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 6
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 5
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 4
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro get request for command 10 failed with status 1
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 3
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro get request for command 11 failed with status 1
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 2
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 1
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: sending message from the queue. Size is now 0
Mar 31 21:21:04 3dr_solo local2.info shot: [callback]: Mode changed from RTL -> LOITER
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro get request for command 10 failed with status 1
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro get request for command 11 failed with status 1
Mar 31 21:21:04 3dr_solo local2.info shot: [gopro]: Gopro get request for command 13 failed with status 1
Mar 31 21:21:04 3dr_solo local2.info shot: [RewindManager] reset Spline to size 20
Mar 31 21:21:05 3dr_solo local2.info shot: [button]: Connected to Artoo.
Mar 31 21:21:05 3dr_solo local2.info shot: [button]: sending FLY to Artoo as mode
The relevant python code from the companion computer that requesting the home location is as follows. It appears Jason was not happy with this method, but Dronekit wasn’t doing the job at the time to do it better.:
def loadHomeLocation(self):
''' Hack method to avoid Dronekit issues with loading home from vehicle'''
if self.vehicle is None:
logger.log("no Vehicle!")
#load home from vehicle
# total grossness for getting HOME_LOCATION! Should be done properly in dronekit instead
self.vehicle.add_message_listener('MISSION_ITEM', self.handleMissionItem)
# formulate mavlink message to request home position
self.vehicle.message_factory.mission_request_send(0, 1, 0) # target_system, target_component, seq
#logger.log("loading home from vehicle2")
def handleMissionItem(self, vehicle, name, msg):
''' Handles callback for home location from vehicle '''
self.vehicle.remove_message_listener('MISSION_ITEM', self.handleMissionItem)
self.homeLocation = LocationGlobal(msg.x, msg.y, msg.z)
logger.log("[RewindManager] loaded home %f %f, alt %f" % (self.homeLocation.lat, self.homeLocation.lon, self.homeLocation.alt))
# Send home to the App
self.updateAppOptions()
def updateAppOptions(self):
''' send home loc to App '''
# f = float_32
# d = float_64
packet = struct.pack('<IIddf', app_packet.SOLO_HOME_LOCATION, 20, self.homeLocation.lat, self.homeLocation.lon, self.homeLocation.alt)
self.shotmgr.appMgr.sendPacket(packet)