sgslib 0.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaae860efa0ec12d6920ac0c2e7498e52b4c858ebe689f8591416187077c0381
4
- data.tar.gz: ef31a4d32a397c6c557c389ccf78a2206050a62bd69f10885fd9ff36f9de5014
3
+ metadata.gz: a7ecb05d8a8096186dd2d79b8126cc50e501e71d5b7c80a58f7b8bcc9a0f7ec0
4
+ data.tar.gz: c4d5073036b612bc4333ad2e176e58c6dae5c262d748a981eb55992526c0a29e
5
5
  SHA512:
6
- metadata.gz: 29df64a13c4e2526137fd7c4c049932f629c5a302285c4d866ee66b239fa7ddd79b816a1e1bb7c120388e71f5d9198c3ebc6bf54f688ef2d48403258f73d5ea2
7
- data.tar.gz: 90f580001c3cd7377acec7abfd0dcbf66e56601187e42bf10339faa6868bec8ee23e241363828cfe0fb5efa99bfcaebf7bb4d8354269707f0503e89014ac2a15
6
+ metadata.gz: 891aa77f6714876a1c2ec5432b760aeab2a7a9421c2e97713dac0ad618f068961142d06020a24eec586222f3ddc4762e1e549461152fa3ab32d18b93b1f046b9
7
+ data.tar.gz: 03d3070b475d819e0f1f855ba6a83fb83596b4c2900a4bb201348570ca9b2e7e5769ab5c9a7f00a3d71c1b31cac12023d362224dd190af01a46695b20df43f7d
data/LICENSE CHANGED
@@ -1,21 +1,28 @@
1
- The MIT License (MIT)
1
+ Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
2
+ reserved.
2
3
 
3
- Copyright (c) 2017 Dermot Tynan
4
+ This program is free software; you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published
6
+ by the Free Software Foundation; either version 2 of the License,
7
+ or (at your option) any later version.
4
8
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
9
+ This program is distributed in the hope that it will be useful, but
10
+ WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ General Public License for more details.
11
13
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program; if not, write to the Free Software Foundation,
16
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
17
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
18
+ THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA ROBOTICS LIMITED
22
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -3,8 +3,32 @@
3
3
  # Sailboat Guidance System
4
4
 
5
5
  The Sailboat Guidance System is a Ruby gem for managing an autonomous, robotic sailboat.
6
- As it stands, it is quite specific to the [Beoga Beag](http://beogabeag.com) boat, but
7
- this will change, over time.
6
+ As it stands, it is quite specific to the
7
+ [Beoga Beag](https://kalopa.com/vessels/2) boat, but this will change, over time
8
+ (**and with your help!**).
9
+
10
+ The architecture is split between a low-level, Arduino-like board and an upper-level
11
+ FreeBSD-based board.
12
+ The low-level board controls the second-by-second operations such as steering,
13
+ sail trim, and battery voltage.
14
+ It is designed to focus on things such as real-time performace, tight PID-control
15
+ loops, and basic telemetry such as voltage/current measurement, electronic compass,
16
+ and wind direction.
17
+ The upper-level board has the advantage of floating-point and the disadvantage of
18
+ a pre-emptive, multiprocess operating system.
19
+ So it focuses on the "bigger picture."
20
+ In this world-view, the GPS is read by the upper-level system.
21
+ Likewise, any satellite communications are handled here.
22
+
23
+ This mimics the way an ocean-going, racing sailboat (such as a Volvo Ocean Race boat)
24
+ would organize itself.
25
+ The two watch teams alternate the constant, 24/7 job of steering and sail trim,
26
+ while the navigator analyses weather systems and makes more strategic decisions.
27
+
28
+ The code in this repository is designed to handle all of the upper-level tasks
29
+ associated with navigation, overall monitoring, reporting and logging, error
30
+ detection, and anything which can be done on an hourly cadence rather than the
31
+ tasks which require constant attention and control.
8
32
 
9
33
  ## Installation
10
34
 
@@ -28,15 +52,27 @@ TODO: Write usage instructions here
28
52
 
29
53
  ## Development
30
54
 
31
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
+ After checking out the repo, run `bin/setup` to install dependencies.
56
+ Then, run `rake spec` to run the tests.
57
+ You can also run `bin/console` for an interactive prompt that will
58
+ allow you to experiment.
32
59
 
33
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
60
+ To install this gem onto your local machine, run `bundle exec rake install`.
61
+ To release a new version, update the version number in `version.rb`,
62
+ and then run `bundle exec rake release`, which will create a git
63
+ tag for the version, push git commits and tags, and push the `.gem`
64
+ file to [rubygems.org](https://rubygems.org).
34
65
 
35
66
  ## Contributing
36
67
 
37
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sgs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
-
68
+ Bug reports and pull requests are welcome on GitHub at
69
+ https://github.com/kalopa/sgslib.
70
+ This project is intended to be a safe, welcoming space for
71
+ collaboration, and contributors are expected to adhere to the
72
+ [Contributor Covenant](http://contributor-covenant.org) code of
73
+ conduct.
39
74
 
40
75
  ## License
41
76
 
42
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
77
+ The gem is available as open source under the terms of the
78
+ [GPL v2 License](http://opensource.org/licenses/gpl-2.0).
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
2
+ #require "rspec/core/rake_task"
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ #RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
7
  task :test => :spec
data/bin/console CHANGED
@@ -1,5 +1,38 @@
1
1
  #!/usr/bin/env ruby
2
-
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ #
3
36
  require "bundler/setup"
4
37
  require "sgslib"
5
38
 
data/exe/sgs_alarm ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This utility daemon is responsible for pulling alarm status from the
36
+ # low-level board, and reporting it as appropriate.
37
+ #
38
+ require 'sgslib'
39
+
40
+ SGS:Alarm.daemon
41
+ exit 0
data/exe/sgs_diag ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # If needed, run a set of diagnostics on the sailboat, to determine if there
36
+ # are issues. Also includes calibrating the compass, etc.
37
+ #
38
+ require 'sgslib'
39
+
40
+ SGS::Diagnostics.daemon
41
+ exit 0
data/exe/sgs_gpsread ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This daemon is responsible for reading from the GPS unit and posting
36
+ # the data to the Redis database, and also sending a GPS message to any
37
+ # and all interested parties.
38
+ #
39
+ require 'sgslib'
40
+
41
+ SGS::GPS.daemon
42
+ exit 0
data/exe/sgs_logger ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This utility daemon is responsible for reporting various system-level
36
+ # activities to the appropriate log files. It attempts to catch all
37
+ # messages thrown by the various daemons, and then writes the message
38
+ # to the log file for possible transmission back to mission control. It
39
+ # is responsible for rolling the log files, and recycling logging space
40
+ # if the log directory starts to fill up - hopefully that won't happen.
41
+ #
42
+ require 'sgslib'
43
+
44
+ SGS::Logger.daemon
45
+ exit 0
data/exe/sgs_mission ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This utility daemon is responsible for reporting various system-level
36
+ # activities to the appropriate log files. It attempts to catch all
37
+ # messages thrown by the various daemons, and then writes the message
38
+ # to the log file for possible transmission back to mission control. It
39
+ # is responsible for rolling the log files, and recycling logging space
40
+ # if the log directory starts to fill up - hopefully that won't happen.
41
+ #
42
+ require 'sgslib'
43
+
44
+ SGS::Mission.daemon
45
+ exit 0
data/exe/sgs_nav ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This is the main navigator function. It listens for GPS messages
36
+ # and computes the mission details from the current boat position. It
37
+ # understands the various boat-state functions so that it won't try to
38
+ # steer the boat if it is in a passive state.
39
+ #
40
+ require 'sgslib'
41
+
42
+ SGS::Navigate.daemon
43
+ exit 0
data/exe/sgs_otto ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This utility daemon handles all communication between the low-level
36
+ # Atmel board ("Otto Von Helm") and the upper-level systems. Any component
37
+ # which needs to interact with the low-level hardware does so using this
38
+ # daemon. Alarms are also processed herein. It will periodically check
39
+ # for various state updates, as well.
40
+ #
41
+ require 'serialport'
42
+ require 'msgpack'
43
+ require 'sgslib'
44
+
45
+ SGS::Otto.daemon
46
+ exit 0
data/exe/sgs_report ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
4
+ # reserved.
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of
9
+ # the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
+ # 02110-1301, USA.
20
+ #
21
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
22
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
25
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ #
34
+ # ABSTRACT
35
+ # This daemon runs periodically to send status reports and alerts back to
36
+ # mission control. Status reports are sent every six hours, and alerts
37
+ # are sent as they happen. It understands the weird interface of the
38
+ # RockBlock and sends compressed log data back to mission control.
39
+ #
40
+ require 'serialport'
41
+ require 'sgslib'
42
+
43
+ SGS::Report.daemon
44
+ exit 0
data/lib/sgs/alarm.rb CHANGED
@@ -1,36 +1,42 @@
1
1
  #
2
- # Copyright (c) 2013, Kalopa Research. All rights reserved. This is free
3
- # software; you can redistribute it and/or modify it under the terms of the
4
- # GNU General Public License as published by the Free Software Foundation;
5
- # either version 2, or (at your option) any later version.
2
+ # Copyright (c) 2013-2023, Kalopa Robotics Limited. All rights
3
+ # reserved.
6
4
  #
7
- # It is distributed in the hope that it will be useful, but WITHOUT
8
- # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
- # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10
- # for more details.
5
+ # This program is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU General Public License as
7
+ # published by the Free Software Foundation; either version 2 of
8
+ # the License, or (at your option) any later version.
11
9
  #
12
- # You should have received a copy of the GNU General Public License along
13
- # with this product; see the file COPYING. If not, write to the Free
14
- # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
15
14
  #
16
- # THIS SOFTWARE IS PROVIDED BY KALOPA RESEARCH "AS IS" AND ANY EXPRESS OR
17
- # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18
- # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
- # IN NO EVENT SHALL KALOPA RESEARCH BE LIABLE FOR ANY DIRECT, INDIRECT,
20
- # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21
- # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22
- # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23
- # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18
+ # 02110-1301, USA.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY KALOPA ROBOTICS LIMITED "AS IS" AND
21
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22
+ # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23
+ # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALOPA
24
+ # ROBOTICS LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27
+ # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ #
33
+ # ABSTRACT
26
34
  #
27
35
 
28
36
  ##
29
37
  # Routines for handling sailboat alarms. Note that this is the definitive
30
38
  # list of alarms on the system. To add or modify an alarm, do so here.
31
39
  #
32
- require 'date'
33
-
34
40
  module SGS
35
41
  ##
36
42
  # Deal with alarm subsystem.
@@ -94,6 +100,32 @@ module SGS
94
100
  super
95
101
  end
96
102
 
103
+ #
104
+ # Main daemon function (called from executable)
105
+ def self.daemon
106
+ loop do
107
+ sleep 300
108
+ end
109
+ end
110
+
111
+ #
112
+ # Build a C include file based on the current alarm definitions
113
+ def self.build_include(fname)
114
+ alarm = new
115
+ File.open(fname, "w") do |f|
116
+ f.puts "/*\n * Autogenerated by #{__FILE__}.\n * DO NOT HAND-EDIT!\n */"
117
+ constants.sort.each do |c|
118
+ unless c == :ALARM_NAMES
119
+ cval = SGS::Alarm.const_get(c)
120
+ str = "#define SGS_ALARM_#{c.to_s}"
121
+ str += "\t" if str.length < 32
122
+ str += "\t#{cval}\t/* #{alarm.name(cval)} */"
123
+ f.puts str
124
+ end
125
+ end
126
+ end
127
+ end
128
+
97
129
  #
98
130
  # Convert an alarm number into a string.
99
131
  def name(alarmno)