From 9bfb5ef9a2cd17c6d21ea7a755d22cf439cd87dc Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Tue, 20 Mar 2012 14:48:53 +1100 Subject: [PATCH 01/17] Making the /Error/ regex match on word boundries so it won't match i2c_error for example. --- tests/LisaL/01_upload.t | 4 ++-- tests/examples/01_compile_all_example_targets.t | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/LisaL/01_upload.t b/tests/LisaL/01_upload.t index c32d5b62b5..56c139579e 100644 --- a/tests/LisaL/01_upload.t +++ b/tests/LisaL/01_upload.t @@ -17,7 +17,7 @@ my $compile_output = run_program( "make $make_compile_options", 0,1); unlike($compile_output, '/Aircraft \'LisaLv11_Booz2v12_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Booz2v12_RC\' not found in\""); -unlike($compile_output, '/Error/i', "The compile output does not contain the word \"Error\""); +unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); #################### # Upload the airframe @@ -27,7 +27,7 @@ my $upload_output = run_program( $ENV{'PAPARAZZI_SRC'}, "make $make_upload_options", 0,1); -unlike($upload_output, '/Error/i', "The upload output does not contain the word \"Error\""); +unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); # Start the server process my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; diff --git a/tests/examples/01_compile_all_example_targets.t b/tests/examples/01_compile_all_example_targets.t index d8cb760458..275a370384 100644 --- a/tests/examples/01_compile_all_example_targets.t +++ b/tests/examples/01_compile_all_example_targets.t @@ -37,7 +37,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) $ENV{'PAPARAZZI_SRC'}, "make $make_upload_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/Error/i', "The upload output does not contain the word \"Error\""); + unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); } } elsif ($process =~ m#target#) @@ -57,7 +57,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) $ENV{'PAPARAZZI_SRC'}, "make $make_upload_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/Error/i', "The upload output does not contain the word \"Error\""); + unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); } } } From 2c9f96252332d9d3159e451918bd21b02d0011fe Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 13:56:33 +1100 Subject: [PATCH 02/17] Changing the testing to not run hardware tests by default. Started to create some sim testing for the Microjet. Removed the test_all_examples target. --- Makefile | 5 +- .../LisaL/{01_upload.t => 01_With_b2_v1.2.t} | 15 ++- tests/LisaL/02_With_aspirin_v1.5_and_overo.t | 94 +++++++++++++++++++ tests/Makefile | 16 +++- tests/sim/01_Microjet.t | 84 +++++++++++++++++ 5 files changed, 199 insertions(+), 15 deletions(-) rename tests/LisaL/{01_upload.t => 01_With_b2_v1.2.t} (87%) create mode 100644 tests/LisaL/02_With_aspirin_v1.5_and_overo.t create mode 100644 tests/sim/01_Microjet.t diff --git a/Makefile b/Makefile index 65e483cf43..95a1d950a2 100644 --- a/Makefile +++ b/Makefile @@ -274,8 +274,5 @@ sw/simulator/launchsitl: chmod a+x $@ test: all replace_current_conf_xml - cd tests; $(MAKE) $(@) - -test_all_example_airframes: replace_current_conf_xml - cd tests; $(MAKE) $(@) TARGET_BOARD=examples + cd tests; $(MAKE) test diff --git a/tests/LisaL/01_upload.t b/tests/LisaL/01_With_b2_v1.2.t similarity index 87% rename from tests/LisaL/01_upload.t rename to tests/LisaL/01_With_b2_v1.2.t index 56c139579e..23f83fdbcf 100644 --- a/tests/LisaL/01_upload.t +++ b/tests/LisaL/01_With_b2_v1.2.t @@ -12,7 +12,7 @@ $|++; # Make the airframe my $make_compile_options = "AIRCRAFT=LisaLv11_Booz2v12_RC clean_ac ap.compile"; my $compile_output = run_program( - "Attempting to build and upload the firmware.", + "Attempting to build the firmware.", $ENV{'PAPARAZZI_SRC'}, "make $make_compile_options", 0,1); @@ -31,25 +31,24 @@ unlike($upload_output, '/\bError\b/i', "The upload output does not contain the w # Start the server process my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; -my $server_options = ""; -my $server = Proc::Background->new($server_command, $server_options); +my @server_options = qw(-n) +my $server = Proc::Background->new($server_command, @server_options); sleep 2; # The service should die in this time if there's an error -ok($server->alive(), "The server started successfully"); +ok($server->alive(), "The server process started successfully"); # Start the link process my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link"; my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123); -#my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600); sleep 2; # The service should die in this time if there's an error my $link = Proc::Background->new($link_command, @link_options); -ok($link->alive(), "The link started successfully"); +ok($link->alive(), "The link process started successfully"); # Open the Ivy bus and read from it... # TODO: learn how to read and write to the Ivy bus # Shutdown the server and link processes -ok($server->die(), "The server shutdown successfully."); -ok($link->die(), "The link shutdown successfully."); +ok($server->die(), "The server process shutdown successfully."); +ok($link->die(), "The link process shutdown successfully."); ################################################################################ # functions used by this test script. diff --git a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t new file mode 100644 index 0000000000..32024c37e1 --- /dev/null +++ b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t @@ -0,0 +1,94 @@ +#!/usr/bin/perl -w + +use Test::More tests => 7; +use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; +use Program; +use Proc::Background; +use Ivy; + +$|++; + +#################### +# Make the airframe +my $make_compile_options = "AIRCRAFT=LisaLv11_Booz2v12_RC clean_ac ap.compile"; +my $compile_output = run_program( + "Attempting to build the firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_compile_options", + 0,1); +unlike($compile_output, '/Aircraft \'LisaLv11_Booz2v12_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Booz2v12_RC\' not found in\""); +unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); + +#################### +# Upload the airframe +my $make_upload_options = "AIRCRAFT=LisaLv11_Booz2v12_RC BOARD_SERIAL=LISA-L-000154 ap.upload"; +my $upload_output = run_program( + "Attempting to build and upload the firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_upload_options", + 0,1); +unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + +# Start the server process +my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; +my @server_options = qw(-n) +my $server = Proc::Background->new($server_command, @server_options); +sleep 2; # The service should die in this time if there's an error +ok($server->alive(), "The server process started successfully"); + +# Start the link process +my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link"; +my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123); +sleep 2; # The service should die in this time if there's an error +my $link = Proc::Background->new($link_command, @link_options); +ok($link->alive(), "The link process started successfully"); + +# Open the Ivy bus and read from it... +# TODO: learn how to read and write to the Ivy bus + +# Shutdown the server and link processes +ok($server->die(), "The server process shutdown successfully."); +ok($link->die(), "The link process shutdown successfully."); + +################################################################################ +# functions used by this test script. +sub run_program +{ + my $message = shift; + my $dir = shift; + my $command = shift; + my $verbose = shift; + my $dont_fail_on_error = shift; + + warn "$message\n" if $verbose; + if (defined $dir) + { + $command = "cd $dir;" . $command; + } + my $prog = new Program("bash"); + my $fh = $prog->open("-c \"$command\""); + warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose; + $fh->autoflush(1); + my @output; + while (<$fh>) + { + warn $_ if $verbose; + chomp $_; + push @output, $_; + } + $fh->close; + my $exit_status = $?/256; + unless ($exit_status == 0) + { + if ($dont_fail_on_error) + { + warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose; + } + else + { + die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n"; + } + } + return wantarray ? @output : join "\n", @output; +} + diff --git a/tests/Makefile b/tests/Makefile index f6eb2bd4b5..e5f6198eb5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,10 +1,20 @@ Q = @ PERL = /usr/bin/perl TEST_VERBOSE = 0 -ifeq ($(TARGET_BOARD),) - TARGET_BOARD = * +NON_TEST_DIRS = lib|results +HARDWARE_REGEX = Lisa|Tiny|Umarim +HARDWARE_TEST_DIRS = $(shell find -L * -d 0 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") +NON_HARDWARE_TEST_DIRS = $(shell find -L * -d 0 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") +ifneq ($(TARGET_BOARD),) + TEST_DIRECTORIES = $(TARGET_BOARD) +else +ifeq ($(TEST_HARDWARE),) + TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) +else + TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) $(HARDWARE_TEST_DIRS) endif -TEST_FILES := $(shell ls $(TARGET_BOARD)/*.t) +endif +TEST_FILES := $(shell ls $(TEST_DIRECTORIES:%=%/*.t)) ifneq ($(JUNIT),) PERLENV=PERL_TEST_HARNESS_DUMP_TAP=$(PAPARAZZI_SRC)/tests/results diff --git a/tests/sim/01_Microjet.t b/tests/sim/01_Microjet.t new file mode 100644 index 0000000000..6dfae3ec49 --- /dev/null +++ b/tests/sim/01_Microjet.t @@ -0,0 +1,84 @@ +#!/usr/bin/perl -w + +use Test::More tests => 6; +use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; +use Program; +use Proc::Background; +use Ivy; + +$|++; + +#################### +# Make the airframe +my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim.compile"; +my $compile_output = run_program( + "Attempting to build the sim firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_compile_options", + 0,1); +unlike($compile_output, '/Aircraft \'Microjet\' not found in/', "The compile output does not contain the message \"Aircraft \'Microjet\' not found in\""); +unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); + +# Start the server process +my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; +my @server_options = qw(-n); +my $server = Proc::Background->new($server_command, @server_options); +sleep 2; # The service should die in this time if there's an error +ok($server->alive(), "The server process started successfully"); + +# Start the sim process +my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl"; +my @link_options = qw(-a -boot -norc); +sleep 2; # The service should die in this time if there's an error +my $link = Proc::Background->new($link_command, @link_options); +ok($link->alive(), "The launchsitl process started successfully"); + +# Open the Ivy bus and read from it... +# TODO: learn how to read and write to the Ivy bus + +# Shutdown the server and link processes +ok($server->die(), "The server process shutdown successfully."); +ok($link->die(), "The launchsitl process shutdown successfully."); + +################################################################################ +# functions used by this test script. +sub run_program +{ + my $message = shift; + my $dir = shift; + my $command = shift; + my $verbose = shift; + my $dont_fail_on_error = shift; + + warn "$message\n" if $verbose; + if (defined $dir) + { + $command = "cd $dir;" . $command; + } + my $prog = new Program("bash"); + my $fh = $prog->open("-c \"$command\""); + warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose; + $fh->autoflush(1); + my @output; + while (<$fh>) + { + warn $_ if $verbose; + chomp $_; + push @output, $_; + } + $fh->close; + my $exit_status = $?/256; + unless ($exit_status == 0) + { + if ($dont_fail_on_error) + { + warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose; + } + else + { + die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n"; + } + } + return wantarray ? @output : join "\n", @output; +} + From a0899c76239ce8f3cc02cce8f5c0bbc603f622f2 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 14:06:29 +1100 Subject: [PATCH 03/17] trying to fix an error on Linux for the finding of test directories. --- tests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index e5f6198eb5..4a3eba6134 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,8 +3,8 @@ PERL = /usr/bin/perl TEST_VERBOSE = 0 NON_TEST_DIRS = lib|results HARDWARE_REGEX = Lisa|Tiny|Umarim -HARDWARE_TEST_DIRS = $(shell find -L * -d 0 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") -NON_HARDWARE_TEST_DIRS = $(shell find -L * -d 0 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") +HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") +NON_HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") ifneq ($(TARGET_BOARD),) TEST_DIRECTORIES = $(TARGET_BOARD) else From 406fe3f3cc51e1c91923c4f96aad024c196509e0 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 14:57:43 +1100 Subject: [PATCH 04/17] Cleaning up the reporting of example airframe compile test messages. Fixing the linux find command issue. Adding a check to see if the Ivy module will load and then skipping tests if it fails to load. --- tests/LisaL/01_With_b2_v1.2.t | 9 ++++--- tests/LisaL/02_With_aspirin_v1.5_and_overo.t | 9 ++++--- tests/Makefile | 4 +-- .../examples/01_compile_all_example_targets.t | 16 ++++++------ tests/sim/01_Microjet.t | 25 +++++++++++-------- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/tests/LisaL/01_With_b2_v1.2.t b/tests/LisaL/01_With_b2_v1.2.t index 23f83fdbcf..1226a524dc 100644 --- a/tests/LisaL/01_With_b2_v1.2.t +++ b/tests/LisaL/01_With_b2_v1.2.t @@ -1,10 +1,9 @@ #!/usr/bin/perl -w -use Test::More tests => 7; +use Test::More tests => 8; use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; use Program; use Proc::Background; -use Ivy; $|++; @@ -44,7 +43,11 @@ my $link = Proc::Background->new($link_command, @link_options); ok($link->alive(), "The link process started successfully"); # Open the Ivy bus and read from it... -# TODO: learn how to read and write to the Ivy bus +SKIP : { + skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} # Shutdown the server and link processes ok($server->die(), "The server process shutdown successfully."); diff --git a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t index 32024c37e1..fbcb7875eb 100644 --- a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t +++ b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t @@ -1,10 +1,9 @@ #!/usr/bin/perl -w -use Test::More tests => 7; +use Test::More tests => 8; use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; use Program; use Proc::Background; -use Ivy; $|++; @@ -44,7 +43,11 @@ my $link = Proc::Background->new($link_command, @link_options); ok($link->alive(), "The link process started successfully"); # Open the Ivy bus and read from it... -# TODO: learn how to read and write to the Ivy bus +SKIP : { + skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} # Shutdown the server and link processes ok($server->die(), "The server process shutdown successfully."); diff --git a/tests/Makefile b/tests/Makefile index 4a3eba6134..ce5ba1e067 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,8 +3,8 @@ PERL = /usr/bin/perl TEST_VERBOSE = 0 NON_TEST_DIRS = lib|results HARDWARE_REGEX = Lisa|Tiny|Umarim -HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") -NON_HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") +HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") +NON_HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") ifneq ($(TARGET_BOARD),) TEST_DIRECTORIES = $(TARGET_BOARD) else diff --git a/tests/examples/01_compile_all_example_targets.t b/tests/examples/01_compile_all_example_targets.t index 275a370384..d16dc8c143 100644 --- a/tests/examples/01_compile_all_example_targets.t +++ b/tests/examples/01_compile_all_example_targets.t @@ -31,13 +31,13 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); #warn "EXAMPLE: [$example] TARGET: [$target]\n"; - my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile"; - my $upload_output = run_program( + my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; + my $output = run_program( "Attempting to build the firmware $target for the airframe $example.", $ENV{'PAPARAZZI_SRC'}, - "make $make_upload_options", + "make $make_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\""); } } elsif ($process =~ m#target#) @@ -51,13 +51,13 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); #warn "EXAMPLET: [$example] TARGET: [$target]\n"; - my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile"; - my $upload_output = run_program( + my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; + my $output = run_program( "Attempting to build the firmware $target for the airframe $example.", $ENV{'PAPARAZZI_SRC'}, - "make $make_upload_options", + "make $make_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\""); } } } diff --git a/tests/sim/01_Microjet.t b/tests/sim/01_Microjet.t index 6dfae3ec49..84959ebdba 100644 --- a/tests/sim/01_Microjet.t +++ b/tests/sim/01_Microjet.t @@ -1,16 +1,15 @@ #!/usr/bin/perl -w -use Test::More tests => 6; +use Test::More tests => 7; use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; use Program; use Proc::Background; -use Ivy; $|++; #################### # Make the airframe -my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim.compile"; +my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim"; my $compile_output = run_program( "Attempting to build the sim firmware.", $ENV{'PAPARAZZI_SRC'}, @@ -26,19 +25,23 @@ my $server = Proc::Background->new($server_command, @server_options); sleep 2; # The service should die in this time if there's an error ok($server->alive(), "The server process started successfully"); -# Start the sim process -my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl"; -my @link_options = qw(-a -boot -norc); +# Start the launchsitl process +my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl"; +my @launchsitl_options = qw(-a -boot -norc); sleep 2; # The service should die in this time if there's an error -my $link = Proc::Background->new($link_command, @link_options); -ok($link->alive(), "The launchsitl process started successfully"); +my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options); +ok($launchsitl->alive(), "The launchsitl process started successfully"); # Open the Ivy bus and read from it... -# TODO: learn how to read and write to the Ivy bus +SKIP : { + skip "Skipping testing of the simulator since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} -# Shutdown the server and link processes +# Shutdown the server and launchsitl processes ok($server->die(), "The server process shutdown successfully."); -ok($link->die(), "The launchsitl process shutdown successfully."); +ok($launchsitl->die(), "The launchsitl process shutdown successfully."); ################################################################################ # functions used by this test script. From d7436518320d31b6ff057dbaeceebe905be17661 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 15:03:31 +1100 Subject: [PATCH 05/17] Correctly targeting the Microjet when starting the launchsitl process. --- tests/sim/01_Microjet.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sim/01_Microjet.t b/tests/sim/01_Microjet.t index 84959ebdba..13d04f89c0 100644 --- a/tests/sim/01_Microjet.t +++ b/tests/sim/01_Microjet.t @@ -27,7 +27,7 @@ ok($server->alive(), "The server process started successfully"); # Start the launchsitl process my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl"; -my @launchsitl_options = qw(-a -boot -norc); +my @launchsitl_options = qw(-a Microjet -boot -norc); sleep 2; # The service should die in this time if there's an error my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options); ok($launchsitl->alive(), "The launchsitl process started successfully"); From 763bd7234d86b33bdc1412175b14d2d0c896064b Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 15:21:42 +1100 Subject: [PATCH 06/17] Adding a clean target to the tests make file to fix a warning when running make clean. Corrected a typo in the LisaL tests. --- tests/LisaL/01_With_b2_v1.2.t | 2 +- tests/LisaL/02_With_aspirin_v1.5_and_overo.t | 2 +- tests/Makefile | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/LisaL/01_With_b2_v1.2.t b/tests/LisaL/01_With_b2_v1.2.t index 1226a524dc..489517660c 100644 --- a/tests/LisaL/01_With_b2_v1.2.t +++ b/tests/LisaL/01_With_b2_v1.2.t @@ -30,7 +30,7 @@ unlike($upload_output, '/\bError\b/i', "The upload output does not contain the w # Start the server process my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; -my @server_options = qw(-n) +my @server_options = qw(-n); my $server = Proc::Background->new($server_command, @server_options); sleep 2; # The service should die in this time if there's an error ok($server->alive(), "The server process started successfully"); diff --git a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t index fbcb7875eb..80eb977f88 100644 --- a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t +++ b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t @@ -30,7 +30,7 @@ unlike($upload_output, '/\bError\b/i', "The upload output does not contain the w # Start the server process my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; -my @server_options = qw(-n) +my @server_options = qw(-n); my $server = Proc::Background->new($server_command, @server_options); sleep 2; # The service should die in this time if there's an error ok($server->alive(), "The server process started successfully"); diff --git a/tests/Makefile b/tests/Makefile index ce5ba1e067..bdbbfa35c6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -27,3 +27,6 @@ endif test: $(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)" +clean: + rm -rf results/* + From 975c8a9c1ba93a60a0b89db54a9b5a6c937f1be4 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 15:43:45 +1100 Subject: [PATCH 07/17] Cleaning up make errors when running make clean. Not cleaning up the test results multiple times. --- Makefile | 1 - sw/in_progress/videolizer/wis-go7007-linux/Makefile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 95a1d950a2..ac929bec4c 100644 --- a/Makefile +++ b/Makefile @@ -238,7 +238,6 @@ clean: $(Q)find . -mindepth 2 -name Makefile -exec sh -c 'echo "Cleaning {}"; $(MAKE) -C `dirname {}` $@' \; $(Q)find . -name '*~' -exec rm -f {} \; $(Q)rm -f paparazzi sw/simulator/launchsitl - $(Q)rm -rf tests/results/* cleanspaces: find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \; diff --git a/sw/in_progress/videolizer/wis-go7007-linux/Makefile b/sw/in_progress/videolizer/wis-go7007-linux/Makefile index abe30d3613..3f130a9785 100644 --- a/sw/in_progress/videolizer/wis-go7007-linux/Makefile +++ b/sw/in_progress/videolizer/wis-go7007-linux/Makefile @@ -89,6 +89,7 @@ endif $(MAKE) install -C apps DESTDIR=$(DESTDIR) clean: - $(MAKE) clean -C $(KSRC) M=$(shell pwd)/kernel + $(MAKE) clean -C $(KSRC) $(shell pwd)/kernel rm -f hotplug/wis-ezusb udev/wis-ezusb.rules $(MAKE) clean -C apps + From b2ec5485e2f95cb54efc2987a21e2ac9ea05e63a Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 16:42:44 +1100 Subject: [PATCH 08/17] Building the correct target aircraft for the LisaL/02_With_aspirin_v1.5_and_overo.t test cases. --- conf/conf.xml.example | 10 ++++++++++ tests/LisaL/02_With_aspirin_v1.5_and_overo.t | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/conf/conf.xml.example b/conf/conf.xml.example index 6554a44879..f604a460ef 100644 --- a/conf/conf.xml.example +++ b/conf/conf.xml.example @@ -89,4 +89,14 @@ settings="settings/settings_booz2.xml" gui_color="white" /> + diff --git a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t index 80eb977f88..a1c948f670 100644 --- a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t +++ b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t @@ -9,18 +9,18 @@ $|++; #################### # Make the airframe -my $make_compile_options = "AIRCRAFT=LisaLv11_Booz2v12_RC clean_ac ap.compile"; +my $make_compile_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC clean_ac ap.compile"; my $compile_output = run_program( "Attempting to build the firmware.", $ENV{'PAPARAZZI_SRC'}, "make $make_compile_options", 0,1); -unlike($compile_output, '/Aircraft \'LisaLv11_Booz2v12_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Booz2v12_RC\' not found in\""); +unlike($compile_output, '/Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in\""); unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); #################### # Upload the airframe -my $make_upload_options = "AIRCRAFT=LisaLv11_Booz2v12_RC BOARD_SERIAL=LISA-L-000154 ap.upload"; +my $make_upload_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC BOARD_SERIAL=LISA-L-000154 ap.upload"; my $upload_output = run_program( "Attempting to build and upload the firmware.", $ENV{'PAPARAZZI_SRC'}, From 7b486eeb8fc860fe5b5a8f6127e9b4e3418325f5 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 17:03:34 +1100 Subject: [PATCH 09/17] Correcting the aircraft id conflict --- conf/conf.xml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/conf.xml.example b/conf/conf.xml.example index f604a460ef..c30ffb913e 100644 --- a/conf/conf.xml.example +++ b/conf/conf.xml.example @@ -91,7 +91,7 @@ /> Date: Wed, 21 Mar 2012 17:20:20 +1100 Subject: [PATCH 10/17] Updated the example airframe for Lisa/L with Aspirin_v1.5 and Overo. Still more work to do but it's better than it was. --- .../LisaL_v1.1_aspirin_v1.5_overo_rc.xml | 290 +++++++++++++++++- 1 file changed, 276 insertions(+), 14 deletions(-) diff --git a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml index fe79b77174..c27f0e6d59 100644 --- a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml +++ b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml @@ -4,20 +4,282 @@ Powered via a plug 12V pack Lisa/L v1.1 board XBee connected to UART2 configured at 38400 - Aspirin v1.5 - overo + Booz2 v1.2 + GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution) --> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ +
+ +
+ +
+ + + +
+
From 4f2fbbca79cdac480562eccf9b1034db42b77e53 Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Wed, 21 Mar 2012 17:31:49 +1100 Subject: [PATCH 11/17] Excluding the sim target for the new example config on mac since it fails due to a JSBSim error --- tests/examples/01_compile_all_example_targets.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/examples/01_compile_all_example_targets.t b/tests/examples/01_compile_all_example_targets.t index d16dc8c143..71f4484928 100644 --- a/tests/examples/01_compile_all_example_targets.t +++ b/tests/examples/01_compile_all_example_targets.t @@ -28,7 +28,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next unless scalar $airframe_config->{'firmware'}->{$process}->{'target'}->{$target}->{'board'}; # Exclude some builds on Mac as they are currently broken. - next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); + next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) ); #warn "EXAMPLE: [$example] TARGET: [$target]\n"; my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; @@ -48,7 +48,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next unless scalar $airframe_config->{'firmware'}->{$process}->{$target}->{'board'}; # Exclude some builds on Mac as they are currently broken. - next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); + next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) ); #warn "EXAMPLET: [$example] TARGET: [$target]\n"; my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; From 1bbaeef8dcc5e63e05b41cfa5adeba880135d50c Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Thu, 22 Mar 2012 14:10:40 +0100 Subject: [PATCH 12/17] actuators_pwm_supervision: removed old/unused booz2_commands --- .../firmwares/rotorcraft/actuators/actuators_pwm_supervision.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c index 4647b682f6..30b4d21075 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c @@ -48,7 +48,6 @@ void actuators_init(void) void actuators_set(bool_t motors_on) { int32_t pwm_commands[COMMANDS_NB]; int32_t pwm_commands_pprz[COMMANDS_NB]; - int32_t booz2_commands[COMMANDS_NB]; pwm_commands[COMMAND_ROLL] = commands[COMMAND_ROLL] * PWM_GAIN_SCALE; pwm_commands[COMMAND_PITCH] = commands[COMMAND_PITCH] * PWM_GAIN_SCALE; From 030732d37e1657cb5315cee0a400c093ad133919 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Thu, 22 Mar 2012 18:00:48 +0100 Subject: [PATCH 13/17] rotorcraft actuators: headers and doxygen --- sw/airborne/firmwares/rotorcraft/actuators.h | 27 ++++++++++++- .../rotorcraft/actuators/actuators_asctec.c | 25 ++++++++++++ .../rotorcraft/actuators/actuators_asctec.h | 40 ++++++++++--------- .../rotorcraft/actuators/actuators_mkk.c | 6 ++- .../rotorcraft/actuators/actuators_mkk.h | 6 ++- .../actuators/actuators_pwm_supervision.c | 8 ++-- .../actuators/actuators_pwm_supervision.h | 9 +++-- .../rotorcraft/actuators/actuators_skiron.c | 4 ++ .../rotorcraft/actuators/actuators_skiron.h | 4 +- .../actuators/arch/stm32/actuators_pwm_arch.c | 7 ++-- .../actuators/arch/stm32/actuators_pwm_arch.h | 7 +--- .../rotorcraft/actuators/supervision.c | 11 +++-- .../rotorcraft/actuators/supervision.h | 27 +++++++++++++ 13 files changed, 136 insertions(+), 45 deletions(-) diff --git a/sw/airborne/firmwares/rotorcraft/actuators.h b/sw/airborne/firmwares/rotorcraft/actuators.h index 23d7988fa4..e8d0c056d1 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators.h +++ b/sw/airborne/firmwares/rotorcraft/actuators.h @@ -1,9 +1,32 @@ +/* + * Copyright (C) 2010-2012 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** @file actuators.h + * Generic Actuators API. + */ + #ifndef ACTUATORS_H #define ACTUATORS_H //#include ACTUATORS -//#include "booz2_servos_direct_hw.h" -//#include "booz2_control_surfaces.h" #include "std.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c index fc55a64aa2..3a2e203e2e 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c @@ -1,3 +1,28 @@ +/* + * Copyright (C) 2008-2009 Antoine Drouin + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** @file actuators_asctec.c + * Actuators driver for Asctec motor controllers. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_asctec.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h index 9b9dc58916..8a7ddddeef 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,26 +19,30 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_asctec.h + * Actuators driver for Asctec motor controllers. + */ + #ifndef ACTUATORS_ASCTEC_H #define ACTUATORS_ASCTEC_H #include "mcu_periph/i2c.h" enum actuators_astec_cmd { NONE, - TEST, - REVERSE, - SET_ADDR }; + TEST, + REVERSE, + SET_ADDR }; enum actuators_astec_addr { FRONT, - BACK, - LEFT, - RIGHT }; + BACK, + LEFT, + RIGHT }; /* this is for the v1 protocol which does its own mixing */ enum actuators_astec_cmds { PITCH, - ROLL, - YAW, - THRUST, + ROLL, + YAW, + THRUST, CMD_NB }; struct ActuatorsAsctec { @@ -56,16 +58,16 @@ struct ActuatorsAsctec { extern struct ActuatorsAsctec actuators_asctec; #define actuators_asctec_SetCommand(_v) { \ - actuators_asctec.cmd = _v; \ -} + actuators_asctec.cmd = _v; \ + } -#define actuators_asctec_SetNewAddr(_v) { \ - actuators_asctec.new_addr = _v; \ -} +#define actuators_asctec_SetNewAddr(_v) { \ + actuators_asctec.new_addr = _v; \ + } -#define actuators_asctec_SetCurAddr(_v) { \ - actuators_asctec.cur_addr = _v; \ -} +#define actuators_asctec_SetCurAddr(_v) { \ + actuators_asctec.cur_addr = _v; \ + } #endif /* ACTUATORS_ASCTEC_H */ diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c index 57289b61dc..3a037eba0d 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_mkk.c + * Actuators driver for Mikrokopter motor controllers. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_mkk.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h index 77b36eb980..a4e5e41f76 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h @@ -1,6 +1,4 @@ /* - * $Id: actuators_mkk.h 3847 2009-08-02 21:47:31Z poine $ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_mkk.h + * Actuators driver for Mikrokopter motor controllers. + */ + #ifndef ACTUATORS_MKK_H #define ACTUATORS_MKK_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c index 30b4d21075..424f832ed9 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_pwm_supervision.h + * PWM actuators with supervision. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/commands.h" #include "actuators_pwm_supervision.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h index cf10740cc2..eead17f8c9 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h @@ -1,7 +1,5 @@ /* - * $Id: actuators_pwm_supervision$ - * - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -19,7 +17,10 @@ * along with paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - * + */ + +/** @file actuators_pwm_supervision.h + * PWM actuators with supervision. */ #ifndef ACTUATORS_PWM_SUPERVISION_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c index 7948a7b5db..b7a3aec3fa 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c @@ -19,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_skiron.c + * Skiron motor speed controller by Michel. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_skiron.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h index 3fc746e967..04c559b6c7 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ -/* Skiron motor speed controller by Michel */ +/** @file actuators_skiron.h + * Skiron motor speed controller by Michel. + */ #ifndef ACTUATORS_SKIRON_H #define ACTUATORS_SKIRON_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c index 6007067d4b..e0335a0a11 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2010 The Paparazzi Team * * This file is part of Paparazzi. @@ -19,7 +17,10 @@ * along with Paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - * + */ + +/** @file arch/stm32/actuators_pwm_arch.c + * STM32 PWM servos handling */ #include "firmwares/rotorcraft/actuators/actuators_pwm.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h index 867cb006e8..480dd466c6 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2010 The Paparazzi Team * * This file is part of Paparazzi. @@ -19,11 +17,10 @@ * along with Paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - * */ -/* - * STM32 PWM servos handling +/** @file arch/stm32/actuators_pwm_arch.h + * STM32 PWM servos handling */ #ifndef ACTUATORS_PWM_ARCH_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/supervision.c index 30ce41af55..a08ad59512 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/supervision.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/supervision.c @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2010 The Paparazzi Team + * Copyright (C) 2008-2012 The Paparazzi Team * * This file is part of Paparazzi. * @@ -19,7 +17,12 @@ * along with Paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - * + */ + +/** @file supervision.c + * Supervision. + * Handles the mapping of roll/pitch/yaw commands + * to actual motor commands. */ #include "firmwares/rotorcraft/actuators/supervision.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h index e8aa343c0b..66621af8eb 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h @@ -1,3 +1,30 @@ +/* + * Copyright (C) 2008-2012 The Paparazzi Team + * + * This file is part of Paparazzi. + * + * Paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** @file supervision.h + * Supervision. + * Handles the mapping of roll/pitch/yaw commands + * to actual motor commands. + */ + #ifndef SUPERVISION_H #define SUPERVISION_H From fe7c72c741a6287510a42ac8dec53795f1482a0b Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Fri, 23 Mar 2012 14:47:17 +0100 Subject: [PATCH 14/17] rotorcraft guidance and stabilization: only documentation and cosmetics --- .../rotorcraft/guidance/guidance_h.c | 7 +++++-- .../rotorcraft/guidance/guidance_h.h | 16 +++++++++----- .../rotorcraft/guidance/guidance_h_ref.h | 7 +++++-- .../rotorcraft/guidance/guidance_v.c | 21 ++++++++++++------- .../rotorcraft/guidance/guidance_v.h | 12 ++++++++++- .../rotorcraft/guidance/guidance_v_ref.h | 5 +++++ .../firmwares/rotorcraft/stabilization.c | 6 ++++-- .../firmwares/rotorcraft/stabilization.h | 11 ++++++++-- .../stabilization/stabilization_none.c | 19 +++++++---------- .../stabilization/stabilization_none.h | 11 +++++++--- .../stabilization/stabilization_rate.c | 8 +++++-- .../stabilization/stabilization_rate.h | 8 +++++-- 12 files changed, 91 insertions(+), 40 deletions(-) diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index 21287d7801..b7e43fc78f 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h.c + * Horizontal guidance for rotorcrafts. + * + */ + #define GUIDANCE_H_C //#define GUIDANCE_H_USE_REF 1 #include "firmwares/rotorcraft/guidance/guidance_h.h" diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h index 20a761d987..fdc49cb05d 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h.h + * Horizontal guidance for rotorcrafts. + * + */ + #ifndef GUIDANCE_H_H #define GUIDANCE_H_H @@ -39,9 +42,12 @@ extern uint8_t guidance_h_mode; -/* horizontal setpoint in NED */ -/* Q_int32_xx_8 */ +/** horizontal position setpoint in NED. + * fixed point representation: Q23.8 + * accuracy 0.0039, range 8388km + */ extern struct Int32Vect2 guidance_h_pos_sp; + extern int32_t guidance_h_psi_sp; extern struct Int32Vect2 guidance_h_pos_ref; extern struct Int32Vect2 guidance_h_speed_ref; @@ -53,7 +59,7 @@ extern struct Int32Vect2 guidance_h_pos_err_sum; extern struct Int32Vect2 guidance_h_nav_err; extern struct Int32Eulers guidance_h_rc_sp; -extern struct Int32Vect2 guidance_h_command_earth; +extern struct Int32Vect2 guidance_h_command_earth; extern struct Int32Eulers guidance_h_command_body; extern int32_t guidance_h_pgain; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h index 1536d9c76b..93d944cf99 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h @@ -1,6 +1,4 @@ /* - * $Id: guidance_v_ref.h 4173 2009-09-18 11:57:21Z flixr $ - * * Copyright (C) 2008-2009 ENAC * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h_ref.h + * Reference generation for horizontal guidance. + * + */ + #ifndef GUIDANCE_H_REF_H #define GUIDANCE_H_REF_H diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index 71cf416a4a..b8664b05fd 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/guidance/guidance_v.c + * Vertical guidance for rotorcrafts. + * + */ + #define GUIDANCE_V_C #define GUIDANCE_V_USE_REF 1 #include "firmwares/rotorcraft/guidance/guidance_v.h" @@ -44,7 +47,7 @@ int32_t guidance_v_delta_t; /** Direct throttle from radio control. - * range 0:200 + * range 0:#MAX_PPRZ */ int32_t guidance_v_rc_delta_t; @@ -127,8 +130,9 @@ void guidance_v_mode_changed(uint8_t new_mode) { } void guidance_v_notify_in_flight( bool_t in_flight) { - if (in_flight) + if (in_flight) { gv_adapt_init(); + } } @@ -157,8 +161,9 @@ void guidance_v_run(bool_t in_flight) { case GUIDANCE_V_MODE_CLIMB: #if USE_FMS - if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB) + if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB) { guidance_v_zd_sp = fms.input.v_sp.climb; + } #endif gv_update_ref_from_zd_sp(guidance_v_zd_sp); run_hover_loop(in_flight); @@ -166,7 +171,7 @@ void guidance_v_run(bool_t in_flight) { stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; #else // saturate max authority with RC stick - stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); #endif break; @@ -181,7 +186,7 @@ void guidance_v_run(bool_t in_flight) { stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; #else // saturate max authority with RC stick - stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); #endif break; @@ -207,7 +212,7 @@ void guidance_v_run(bool_t in_flight) { #else /* use rc limitation if available */ if (radio_control.status == RC_OK) - stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); else stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; #endif diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h index ca39608b06..ded9bd3500 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h @@ -19,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/guidance/guidance_v.h + * Vertical guidance for rotorcrafts. + * + */ + #ifndef GUIDANCE_V #define GUIDANCE_V @@ -82,7 +87,12 @@ extern int32_t guidance_v_zdd_ref; extern int32_t guidance_v_z_sum_err; ///< accumulator for I-gain extern int32_t guidance_v_ff_cmd; ///< feed-forward command extern int32_t guidance_v_fb_cmd; ///< feed-back command -extern int32_t guidance_v_delta_t; ///< command output (ff+fb) + +/** thrust command. + * summation of feed-forward and feed-back commands, + * valid range 0 : #MAX_PPRZ + */ +extern int32_t guidance_v_delta_t; extern int32_t guidance_v_kp; ///< vertical control P-gain extern int32_t guidance_v_kd; ///< vertical control D-gain diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h index 171acc679d..695d6f1a23 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h @@ -19,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firwmares/rotorcraft/guidance/guidance_v_ref.h + * Reference generation for vertical guidance. + * + */ + #ifndef GUIDANCE_V_REF_H #define GUIDANCE_V_REF_H diff --git a/sw/airborne/firmwares/rotorcraft/stabilization.c b/sw/airborne/firmwares/rotorcraft/stabilization.c index 449d30eff3..e2cbfc39ef 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/stabilization.c + * General stabilization interface for rotorcrafts. + */ + #include "firmwares/rotorcraft/stabilization.h" int32_t stabilization_cmd[COMMANDS_NB]; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization.h b/sw/airborne/firmwares/rotorcraft/stabilization.h index fae6fa0b06..d693e6a1f0 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/stabilization.h + * General stabilization interface for rotorcrafts. + */ + #ifndef STABILIZATION_H #define STABILIZATION_H @@ -35,6 +37,11 @@ extern void stabilization_init(void); +/** Stabilization commands. + * Contains the resulting stabilization commands, + * regardless of whether rate or attitude is currently used. + * Range -MAX_PPRZ:MAX_PPRZ + */ extern int32_t stabilization_cmd[COMMANDS_NB]; #endif /* STABILIZATION_H */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c index 687449636a..cd78cdb9b8 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2009 Antoine Drouin - * Copyright (C) 2010 Felix Ruess + * Copyright (C) 2011-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -22,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_none.c + * Dummy stabilization for rotorcrafts. + * + * Doesn't actually do any stabilization, + * just directly passes the RC commands along. + */ + #include "firmwares/rotorcraft/stabilization.h" #include "firmwares/rotorcraft/stabilization/stabilization_none.h" @@ -42,19 +46,12 @@ struct Int32Rates stabilization_none_rc_cmd; void stabilization_none_init(void) { - INT_RATES_ZERO(stabilization_none_rc_cmd); - } - void stabilization_none_read_rc( void ) { - - stabilization_none_rc_cmd.p = (int32_t)-radio_control.values[RADIO_ROLL]; - stabilization_none_rc_cmd.q = (int32_t)radio_control.values[RADIO_PITCH]; - stabilization_none_rc_cmd.r = (int32_t)-radio_control.values[RADIO_YAW]; } diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h index 515d4e844a..07ddd22aca 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2009 Antoine Drouin + * Copyright (C) 2011-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -21,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_none.h + * Dummy stabilization for rotorcrafts. + * + * Doesn't actually do any stabilization, + * just directly passes the RC commands along. + */ + #ifndef STABILIZATION_NONE #define STABILIZATION_NONE diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c index 44ff7ac984..2a43e9ee7c 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * Copyright (C) 2010 Felix Ruess * @@ -22,6 +20,12 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_rate.c + * Rate stabilization for rotorcrafts. + * + * Control loops for angular velocity. + */ + #include "firmwares/rotorcraft/stabilization.h" #include "subsystems/ahrs.h" diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h index 741b3c4fb0..41a6eaf99b 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,12 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_rate.h + * Rate stabilization for rotorcrafts. + * + * Control loops for angular velocity. + */ + #ifndef STABILIZATION_RATE #define STABILIZATION_RATE From fa39419a03a84f9335d73fa6b5a9dce6b81f277d Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Fri, 23 Mar 2012 16:51:42 +0100 Subject: [PATCH 15/17] board makefiles: allow to configure other ACTUATORS in airframe file and no more including of other makefiles --- conf/boards/lisa_l_1.0.makefile | 8 +++ conf/boards/lisa_l_1.1.makefile | 105 +++++++++++++++++++++++++++++++- conf/boards/lisa_m_1.0.makefile | 14 +---- conf/boards/lisa_m_2.0.makefile | 89 ++++++++++++++++++++++++++- conf/boards/navgo_1.0.makefile | 4 +- conf/boards/tiny_0.99.makefile | 76 +++++++++++++++++++++-- conf/boards/tiny_1.1.makefile | 71 +++++++++++++++++++-- conf/boards/tiny_2.1.makefile | 73 +++++++++++++++++++++- conf/boards/tiny_2.11.makefile | 17 +++++- conf/boards/twog_1.0.makefile | 73 +++++++++++++++++++++- conf/boards/twog_1.makefile | 2 - conf/boards/umarim_1.0.makefile | 18 +++++- 12 files changed, 511 insertions(+), 39 deletions(-) delete mode 100644 conf/boards/twog_1.makefile diff --git a/conf/boards/lisa_l_1.0.makefile b/conf/boards/lisa_l_1.0.makefile index d5ebd0ba1f..2e427d0207 100644 --- a/conf/boards/lisa_l_1.0.makefile +++ b/conf/boards/lisa_l_1.0.makefile @@ -59,8 +59,16 @@ ifndef SYS_TIME_LED SYS_TIME_LED = 1 endif + +# +# default uart configuration +# +ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 +endif +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif ifndef MODEM_PORT MODEM_PORT=UART2 diff --git a/conf/boards/lisa_l_1.1.makefile b/conf/boards/lisa_l_1.1.makefile index 6f15ce905f..2bab50dddf 100644 --- a/conf/boards/lisa_l_1.1.makefile +++ b/conf/boards/lisa_l_1.1.makefile @@ -1,11 +1,112 @@ # Hey Emacs, this is a -*- makefile -*- +# +# lisa_l_1.1.makefile +# +# http://paparazzi.enac.fr/wiki/User/LisaL +# -include $(PAPARAZZI_SRC)/conf/boards/lisa_l_1.0.makefile +BOARD=lisa_l +BOARD_VERSION=1.1 +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +# ----------------------------------------------------------------------- +ifeq ($(BOARD_PROCESSOR),'omap') + + ARCH = omap + $(TARGET).LDFLAGS += -levent -lm + +# ----------------------------------------------------------------------- +else + + ARCH=stm32 + + $(TARGET).ARCHDIR = $(ARCH) +# not needed? + +endif +# ----------------------------------------------------------------------- + +ifndef FLASH_MODE +FLASH_MODE = JTAG +endif + +# +# +# some default values shared between different firmwares +# +# + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = 5 +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = 7 +endif + +ifndef GPS_LED +GPS_LED = 3 +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = 1 +endif + + +# +# default uart configuration +# +ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT +RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 +endif +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT +RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif + +ifndef MODEM_PORT +MODEM_PORT=UART2 +endif +ifndef MODEM_BAUD +MODEM_BAUD=B57600 +endif + +ifndef GPS_PORT +GPS_PORT=UART1 +endif +ifndef GPS_BAUD +GPS_BAUD=B38400 +endif # # this is the DRDY pin of a max1168 on a booz IMU # -# v1.1 +# v 1.1 # MAX_1168_DRDY_PORT = _GPIOB MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOB +# v1.1 +#MAX_1168_DRDY_PORT = GPIOB + + +ifndef ADC_IR1 +ADC_IR1 = 1 +ADC_IR1_CHAN = 0 +endif +ifndef ADC_IR2 +ADC_IR2 = 2 +ADC_IR2_CHAN = 1 +endif +ifndef ADC_IR3 +ADC_IR_TOP = 4 +ADC_IR_TOP_CHAN = 3 +endif +ifndef ADC_IR_NB_SAMPLES +ADC_IR_NB_SAMPLES = 16 +endif diff --git a/conf/boards/lisa_m_1.0.makefile b/conf/boards/lisa_m_1.0.makefile index ce53ca3c06..b2e64f84cb 100644 --- a/conf/boards/lisa_m_1.0.makefile +++ b/conf/boards/lisa_m_1.0.makefile @@ -52,6 +52,9 @@ ifndef SYS_TIME_LED SYS_TIME_LED = 1 endif +# +# default uart configuration +# ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 endif @@ -76,17 +79,6 @@ GPS_BAUD=B38400 endif -# -# this is the DRDY pin of a max1168 on a booz IMU -# -# v 1.0 -# -MAX_1168_DRDY_PORT = _GPIOD -MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD -# v1.1 -#MAX_1168_DRDY_PORT = GPIOB - - ifndef ADC_IR1 ADC_IR1 = 1 diff --git a/conf/boards/lisa_m_2.0.makefile b/conf/boards/lisa_m_2.0.makefile index 2e9f366483..8040376e97 100644 --- a/conf/boards/lisa_m_2.0.makefile +++ b/conf/boards/lisa_m_2.0.makefile @@ -1,12 +1,97 @@ # Hey Emacs, this is a -*- makefile -*- +# +# lisa_m_2.0.makefile +# +# http://paparazzi.enac.fr/wiki/Lisa/M +# + +BOARD=lisa_m +BOARD_VERSION=1.0 +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +ARCH=stm32 +$(TARGET).ARCHDIR = $(ARCH) +# not needed? +$(TARGET).OOCD_INTERFACE=flossjtag +#$(TARGET).OOCD_INTERFACE=jtagkey-tiny + +# ----------------------------------------------------------------------- + +ifndef FLASH_MODE +FLASH_MODE = JTAG +#FLASH_MODE = SERIAL +endif # -# Swap GPS UART with spektrum UART # +# some default values shared between different firmwares +# +# + + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = none +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = none +endif + +ifndef GPS_LED +GPS_LED = none +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = 1 +endif + +# +# default uart configuration +# +ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART1 +endif + +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT +RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif + +ifndef MODEM_PORT +MODEM_PORT=UART2 +endif +ifndef MODEM_BAUD +MODEM_BAUD=B57600 +endif + ifndef GPS_PORT GPS_PORT=UART3 endif +ifndef GPS_BAUD +GPS_BAUD=B38400 +endif -include $(PAPARAZZI_SRC)/conf/boards/lisa_m_1.0.makefile + + +ifndef ADC_IR1 +ADC_IR1 = 1 +ADC_IR1_CHAN = 0 +endif +ifndef ADC_IR2 +ADC_IR2 = 2 +ADC_IR2_CHAN = 1 +endif +ifndef ADC_IR3 +ADC_IR_TOP = 4 +ADC_IR_TOP_CHAN = 3 +endif +ifndef ADC_IR_NB_SAMPLES +ADC_IR_NB_SAMPLES = 16 +endif diff --git a/conf/boards/navgo_1.0.makefile b/conf/boards/navgo_1.0.makefile index 75b42e53f4..2fad0c60a2 100644 --- a/conf/boards/navgo_1.0.makefile +++ b/conf/boards/navgo_1.0.makefile @@ -44,7 +44,9 @@ SYS_TIME_LED = none endif -### default settings +# +# default uart settings +# ifndef GPS_PORT GPS_PORT = UART0 endif diff --git a/conf/boards/tiny_0.99.makefile b/conf/boards/tiny_0.99.makefile index f3879c0b70..64650b82a1 100644 --- a/conf/boards/tiny_0.99.makefile +++ b/conf/boards/tiny_0.99.makefile @@ -4,17 +4,81 @@ # http://paparazzi.enac.fr/wiki/Tiny_v0.99 # - -include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile - +ARCH=lpc21 BOARD=tiny BOARD_VERSION=0.99 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" -GPS_PORT = UART1 -GPS_LED = none -MODEM_PORT = UART0 +ifndef FLASH_MODE +FLASH_MODE = IAP +endif + + +LPC21ISP_BAUD = 38400 +LPC21ISP_XTAL = 12000 + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = none +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = none +endif + +ifndef GPS_LED +GPS_LED = none +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = none +endif + + +# +# default uart settings +# +ifndef GPS_PORT +GPS_PORT = UART1 +endif +ifndef GPS_BAUD +GPS_BAUD = B38400 +endif + +ifndef MODEM_PORT +MODEM_PORT = UART0 +endif +ifndef MODEM_BAUD +MODEM_BAUD = B57600 +endif + + + +ADC_IR_TOP = ADC_0 +ADC_IR1 = ADC_1 +ADC_IR2 = ADC_2 +ADC_IR_NB_SAMPLES = 16 +ADC_GYRO_NB_SAMPLES = 16 + +ADC_GENERIC_NB_SAMPLES = 16 + +# +# you can use different actuators by adding a configure option to your firmware section +# e.g. in your airframe config!) diff --git a/conf/boards/umarim_1.0.makefile b/conf/boards/umarim_1.0.makefile index c1eb9b600e..7a6a7554d8 100644 --- a/conf/boards/umarim_1.0.makefile +++ b/conf/boards/umarim_1.0.makefile @@ -11,6 +11,7 @@ BOARD_VERSION=1.0 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + ifndef FLASH_MODE FLASH_MODE = IAP endif @@ -44,7 +45,9 @@ SYS_TIME_LED = none endif -### default settings +# +# default uart settings +# ifndef GPS_PORT GPS_PORT = UART0 endif @@ -59,9 +62,18 @@ ifndef MODEM_BAUD MODEM_BAUD = B57600 endif + + ADC_GENERIC_NB_SAMPLES = 16 +# +# you can use different actuators by adding a configure option to your firmware section +# e.g. Date: Sun, 25 Mar 2012 17:23:51 +0200 Subject: [PATCH 17/17] rotorcraft guidance: if quaternion stabilization is used, compute quat setpoint from eulers in hover and attitude nav as well --- sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index b7e43fc78f..b2d7018f77 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -204,6 +204,9 @@ void guidance_h_run(bool_t in_flight) { #ifndef STABILISATION_ATTITUDE_TYPE_FLOAT stab_att_sp_euler.phi = nav_roll << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); stab_att_sp_euler.theta = nav_pitch << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); +#ifdef STABILISATION_ATTITUDE_TYPE_QUAT + INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler); +#endif #endif } else { @@ -289,6 +292,9 @@ __attribute__ ((always_inline)) static inline void guidance_h_hover_run(void) { #endif /* STABILISATION_ATTITUDE_TYPE_FLOAT */ EULERS_COPY(stab_att_sp_euler, guidance_h_command_body); +#ifdef STABILISATION_ATTITUDE_TYPE_QUAT + INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler); +#endif }