aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/robotics.scm
blob: fbf10be366f142354cf29d5aacc9b6dbb694197c (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix 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 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix 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 GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages robotics)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages sdl)
  #:use-module (gnu packages valgrind)
  #:use-module (gnu packages xml))

(define-public enki
  ;; Previous versions use Qt4 and are unsuitable for Aseba.
  (let ((commit "afd2d8e2f91c095f6745505ca1f32f31ea874200")
        (revision "0"))
    (package
      (name "enki")
      (version (git-version "2.0pre" revision commit))
      (home-page "https://github.com/enki-community/enki/")
      (source (origin
                (method git-fetch)
                (uri (git-reference (url home-page) (commit commit)))
                (sha256
                 (base32
                  "1d1901zzsfml97hb4mb3ah3ab1bk4kh7bn6m7xrj1rv0gk9wkhq7"))
                (file-name (string-append name "-" version "-checkout"))))
      (build-system cmake-build-system)
      (arguments
       '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
      (native-inputs `(("pkg-config" ,pkg-config)))
      (inputs
       ;; Optionally, add Python + Boost for Python bindings.
       `(("sdl2" ,sdl2)))
      (propagated-inputs
       ;; 'Viewer.h' includes 'QGLWidget'.
       `(("qtbase" ,qtbase)                ;the viewer module needs Qt5 + MESA
         ("mesa" ,mesa)))
      (synopsis "Robot simulator")
      (description
       "Enki is a robot simulator written in C++.  It provides collision and
limited physics support for robots evolving on a flat surface.  On a
contemporary desktop computer, Enki is able to simulate groups of robots
hundred times faster than real-time.")

      ;; The 'LICENSE' file as well as source file headers says that
      ;; researchers using the software are "asked" to cite using a given
      ;; citation, but that sentence is written as not being part of the
      ;; license (fortunately).
      (license license:gpl2+))))

(define-public aseba
  ;; Use the commit that allows us to build with Qt5.
  (let ((commit "3b35de80d5fdd47592b1c01d57e1f4ef37c5e5ea")
        (revision "0"))
    (package
      (name "aseba")
      (version (git-version "1.6.0" revision commit))
      (home-page "https://github.com/aseba-community/aseba")
      (source (origin
                (method git-fetch)
                (uri (git-reference (url home-page) (commit commit)
                                    (recursive? #t))) ;for Blockly
                (sha256
                 (base32
                  "0j31lmc9f0ksvkh0md2fgsz92hcsrwnrqqcynamizs2ah8iwlqi5"))
                (file-name (string-append name "-" version "-checkout"))
                (modules '((guix build utils)))
                (snippet
                 ;; Add missing Qt5::Network.
                 '(begin
                    (substitute* "targets/playground/CMakeLists.txt"
                      (("target_link_libraries(.*)\\$\\{EXTRA_LIBS\\}" _ middle)
                       (string-append "target_link_libraries" middle
                                      " Qt5::Network ${EXTRA_LIBS}")))
                    #t))))
      (build-system cmake-build-system)
      (arguments
       '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
      (native-inputs
       `(("pkg-config" ,pkg-config)
         ("valgrind" ,valgrind)))                 ;for tests
      (inputs
       `(("dashel" ,dashel)
         ("enki" ,enki)
         ("protobuf" ,protobuf-3.5)               ;for logging
         ("qtbase" ,qtbase)
         ("qtsvg" ,qtsvg)
         ("qttools" ,qttools)              ;for libQt5Help, needed by "studio"
         ("qtwebkit" ,qtwebkit)
         ("qtx11extras" ,qtx11extras)
         ("eudev" ,eudev)
         ("libxml2" ,libxml2)
         ("sdl2" ,sdl2)
         ("avahi" ,avahi)))            ;XXX: we need the libdnssd compat layer
      (synopsis "Event-based robot programming tools")
      (description
       "Aseba means @dfn{actuator and sensor event-based architecture}.
It is a set of tools which allow beginners to program robots easily and
efficiently.  It includes robot simulators, a programming language, and a
visual programming language (VPL) that is notably used together with the
Thymio educational robot.")

      ;; Source file headers say "version 3.0" without "or any later version".
      (license license:lgpl3))))
le.css.jinja?id=ccf3ce18220f3256a7cf96ed32f26511a5d01337'>src/hydrilla/proxy/web_ui/templates/include/item_list_style.css.jinja
@@ -25,14 +25,29 @@ ul#item_list {
ul#item_list > li {
list-style-type: none;
max-width: 100%;
- overflow-x: scroll;
white-space: nowrap;
- margin: 5px;
+ margin: 0 5px 0 5px;
}
ul#item_list > li > :only-child {
display: block;
padding: 5px;
- border: 2px solid #999;
- border-radius: 5px;
+ overflow-x: scroll;
+ border-bottom: 2px solid #999;
+}
+
+ul#item_list > li.entry-line-dashed > :only-child {
+ border-bottom-style: dashed
+}
+
+ul#item_list > li.entry-line-green > :only-child {
+ border-color: #4caf50;
+}
+
+ul#item_list > li.entry-line-blue > :only-child {
+ border-color: #504caf;
+}
+
+ul#item_list > li.entry-line-red > :only-child {
+ border-color: #af504c;
}
diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja
index 1ad8df3..07212ff 100644
--- a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja
@@ -21,7 +21,7 @@ in a proprietary work, I am not going to enforce this in court.
{% extends "base.html.jinja" %}
{% macro versioned_identifier_with_repo(info) %}
- {{ info.info.versioned_identifier }}
+ {{ info.info.version_string }}
{% if not info.is_local %}
@
{{ info.info.repo }}
@@ -32,6 +32,10 @@ in a proprietary work, I am not going to enforce this in court.
{{ super() }}
{% include 'include/item_list_style.css.jinja' %}
+
+ .textcolor-gray {
+ color: #777;
+ }
{% endblock %}
{% block main %}
{% block main_info %}
@@ -49,12 +53,23 @@ in a proprietary work, I am not going to enforce this in court.
version_display_info.ref != info.ref
%}
{% set entry_classes = [] %}
- {% if info.is_local %}
- {% do entry_classes.append('version-entry-local') %}
+
+ {% if info.is_orphan or info.is_local %}
+ {% do entry_classes.append('textcolor-gray') %}
{% endif %}
- {% if info.is_orphan %}
- {% do entry_classes.append('version-entry-orphan') %}
+
+ {% if info.active == ActiveStatus.REQUIRED %}
+ {% do entry_classes.append('entry-line-blue') %}
+ {%
+ if display_info.type != ItemType.MAPPING or
+ display_info.enabled != EnabledStatus.ENABLED
+ %}
+ {% do entry_classes.append('entry-line-dashed') %}
+ {% endif %}
+ {% elif info.active == ActiveStatus.AUTO %}
+ {% do entry_classes.append('entry-line-green') %}
{% endif %}
+
<li class="{{ entry_classes|join(' ') }}">
{%
set href = url_for(
diff --git a/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja
index 172c040..77874cb 100644
--- a/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/items/libraries.html.jinja
@@ -24,6 +24,13 @@ in a proprietary work, I am not going to enforce this in court.
{{ super() }}
{% include 'include/item_list_style.css.jinja' %}
+
+ ul#item_list > li > a {
+ display: flex !important;
+ flex-direction: column;
+ justify-content: center;
+ min-height: 2.2em;
+ }
{% endblock %}
{% block main %}
<h3>{{ _('web_ui.libraries.heading') }}</h3>
diff --git a/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja
index d2eaaf3..093570d 100644
--- a/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/items/packages.html.jinja
@@ -24,17 +24,33 @@ in a proprietary work, I am not going to enforce this in court.
{{ super() }}
{% include 'include/item_list_style.css.jinja' %}
+
+ ul#item_list > li > a {
+ display: flex !important;
+ flex-direction: column;
+ justify-content: center;
+ min-height: 2.2em;
+ }
{% endblock %}
{% block main %}
<h3>{{ _('web_ui.packages.heading') }}</h3>
<ul id="item_list">
{% for info in display_infos %}
{% set entry_classes = [] %}
+
{% if info.enabled == EnabledStatus.ENABLED %}
- {% do entry_classes.append('mapping-entry-enabled') %}
+ {% do entry_classes.append('entry-line-blue') %}
{% elif info.enabled == EnabledStatus.DISABLED %}
- {% do entry_classes.append('mapping-entry-disabled') %}
+ {% do entry_classes.append('entry-line-red') %}
+ {% elif info.active_version is not none %}
+ {% if info.active_version.active == ActiveStatus.REQUIRED %}
+ {% do entry_classes.append('entry-line-blue') %}
+ {% do entry_classes.append('entry-line-dashed') %}
+ {% elif info.active_version.active == ActiveStatus.AUTO %}
+ {% do entry_classes.append('entry-line-green') %}
+ {% endif %}
{% endif %}
+
<li class="{{ entry_classes|join(' ') }}">
<a href="{{ url_for('.show_package', item_id=info.ref.id) }}">
<div>
diff --git a/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja
index c0cc6cb..07506e8 100644
--- a/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/repos/index.html.jinja
@@ -35,9 +35,13 @@ in a proprietary work, I am not going to enforce this in court.
<ul id="item_list">
{% for info in display_infos %}
{% set entry_classes = [] %}
+
{% if info.deleted %}
- {% do entry_classes.append('repo-entry-deleted') %}
+ {% do entry_classes.append('entry-line-red') %}
+ {% else %}
+ {% do entry_classes.append('entry-line-green') %}
{% endif %}
+
<li class="{{ entry_classes|join(' ') }}">
<a href="{{ url_for('.show_repo', repo_id=info.ref.id) }}">
<div>
@@ -54,16 +58,22 @@ in a proprietary work, I am not going to enforce this in court.
</a>
</li>
{% endfor %}
- <li>
- <a href="{{ url_for('.show_repo', repo_id=local_semirepo_info.ref.id) }}">
- {{ _('web_ui.repos.local_packages_semirepo') }}
- <div class="small-print">
- {{
- _('web_ui.repos.package_count_{}')
- .format(local_semirepo_info.mapping_count)
- }}
- </div>
- </a>
- </li>
+ {%
+ if local_semirepo_info.mapping_count > 0 or
+ local_semirepo_info.resource_count > 0
+ %}
+ {% set url = url_for('.show_repo', repo_id=local_semirepo_info.ref.id) %}
+ <li>
+ <a href="{{ url }}">
+ {{ _('web_ui.repos.local_packages_semirepo') }}
+ <div class="small-print">
+ {{
+ _('web_ui.repos.package_count_{}')
+ .format(local_semirepo_info.mapping_count)
+ }}
+ </div>
+ </a>
+ </li>
+ {% endif %}
</ul>
{% endblock %}