Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit 89ae747

Browse files
PIXHAWK: Removed param loads
The parameter setting as part of a factory reset is no longer needed since the ArduCopter firmware for both stock and green cubes has the defaults baked in. This will shorten the installation time, and remove 2 automated reboots.
1 parent c086607 commit 89ae747

1 file changed

Lines changed: 2 additions & 37 deletions

File tree

flightcode/python/pixhawk.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -737,37 +737,6 @@ def recoveryCheck():
737737
logger.info("On recovery partition")
738738
return True
739739

740-
def setReqParams():
741-
logger.info(" Setting some important parameters...")
742-
config = ConfigParser.SafeConfigParser()
743-
config.optionxform = str
744-
config.read(sololink_conf)
745-
746-
serial_dev = config_get(config, config_dev_name)
747-
if serial_dev is None:
748-
return
749-
750-
serial_flow = config_getbool(config, config_flow_name, True)
751-
752-
serial_baud = config_getint(config, config_baud_name)
753-
if serial_baud is None:
754-
return
755-
756-
m = mavutil.mavlink_connection(serial_dev, baud=serial_baud)
757-
m.set_rtscts(serial_flow)
758-
m.mav.param_set_send(m.target_system, m.target_component, 'NTF_OREO_THEME', 1, 0)
759-
time.sleep(1)
760-
m.mav.param_set_send(m.target_system, m.target_component, 'MNT_TYPE', 2, 0)
761-
time.sleep(1)
762-
m.mav.param_set_send(m.target_system, m.target_component, 'FRAME_CLASS', 1, 0)
763-
time.sleep(1)
764-
m.mav.param_set_send(m.target_system, m.target_component, 'FRAME_TYPE', 1, 0)
765-
time.sleep(1)
766-
m.mav.param_set_send(m.target_system, m.target_component, 'BATT_MONITOR', 5, 0)
767-
time.sleep(5)
768-
m.close()
769-
return
770-
771740
def rebootPixhawk():
772741
logger.info(" Rebooting pixhawk...")
773742
global cube_version
@@ -815,8 +784,6 @@ def initialize():
815784
if recoveryCheck():
816785
resetParameters()
817786
rebootPixhawk()
818-
setReqParams()
819-
rebootPixhawk()
820787
else:
821788
if (os.path.isdir("/firmware/3dr") or os.path.isdir("/firmware/green")) and checkPixhawkVersion():
822789
# This must be a clean install if the initial FW directories are here.
@@ -844,12 +811,10 @@ def initialize():
844811
os.system("rm -rf /firmware/green")
845812
os.system("rm -rf /firmware/wipe")
846813
if paramsAfterLoad:
847-
logger.info("Executing post-install cleanups...")
814+
logger.info("Executing post-install parameter reset...")
848815
resetParameters()
849816
rebootPixhawk()
850-
setReqParams()
851-
rebootPixhawk()
852-
logger.info("Cleanups complete")
817+
logger.info("...Reset complete")
853818
else:
854819
print "pixhawk: ERROR loading firmware"
855820
logger.error("pixhawk status: can't load")

0 commit comments

Comments
 (0)