sgslib 0.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +24 -17
- data/README.md +43 -7
- data/Rakefile +2 -2
- data/bin/console +34 -1
- data/exe/sgs_alarm +41 -0
- data/exe/sgs_diag +41 -0
- data/exe/sgs_gpsread +42 -0
- data/exe/sgs_logger +45 -0
- data/exe/sgs_mission +45 -0
- data/exe/sgs_nav +43 -0
- data/exe/sgs_otto +46 -0
- data/exe/sgs_report +44 -0
- data/lib/sgs/alarm.rb +55 -23
- data/lib/sgs/bearing.rb +150 -0
- data/lib/sgs/config.rb +35 -24
- data/lib/sgs/course.rb +29 -24
- data/lib/sgs/diagnostics.rb +49 -0
- data/lib/sgs/gps.rb +37 -21
- data/lib/sgs/location.rb +58 -159
- data/lib/sgs/logger.rb +35 -82
- data/lib/sgs/mission.rb +96 -173
- data/lib/sgs/mission_status.rb +128 -0
- data/lib/sgs/navigate.rb +37 -21
- data/lib/sgs/nmea.rb +32 -22
- data/lib/sgs/otto.rb +37 -21
- data/lib/sgs/redis_base.rb +32 -24
- data/lib/sgs/report.rb +49 -0
- data/lib/sgs/rpc.rb +29 -21
- data/lib/sgs/timing.rb +32 -24
- data/lib/sgs/version.rb +35 -1
- data/lib/sgs/waypoint.rb +69 -33
- data/lib/sgslib.rb +40 -24
- data/sgslib.gemspec +15 -5
- metadata +61 -19
- data/.gitignore +0 -9
- data/.rspec +0 -2
- data/.travis.yml +0 -4
- data/CODE_OF_CONDUCT.md +0 -49
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7ecb05d8a8096186dd2d79b8126cc50e501e71d5b7c80a58f7b8bcc9a0f7ec0
|
4
|
+
data.tar.gz: c4d5073036b612bc4333ad2e176e58c6dae5c262d748a981eb55992526c0a29e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 891aa77f6714876a1c2ec5432b760aeab2a7a9421c2e97713dac0ad618f068961142d06020a24eec586222f3ddc4762e1e549461152fa3ab32d18b93b1f046b9
|
7
|
+
data.tar.gz: 03d3070b475d819e0f1f855ba6a83fb83596b4c2900a4bb201348570ca9b2e7e5769ab5c9a7f00a3d71c1b31cac12023d362224dd190af01a46695b20df43f7d
|
data/LICENSE
CHANGED
@@ -1,21 +1,28 @@
|
|
1
|
-
|
1
|
+
Copyright (c) 2014-2023, Kalopa Robotics Limited. All rights
|
2
|
+
reserved.
|
2
3
|
|
3
|
-
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
13
|
-
|
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
|
-
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
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.
|
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`.
|
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
|
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
|
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
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
|
3
|
-
#
|
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
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
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
|
-
#
|
13
|
-
#
|
14
|
-
#
|
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
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
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)
|