diff --git a/aruco_markers/.gitignore b/aruco_markers/.gitignore new file mode 100644 index 0000000..225c381 --- /dev/null +++ b/aruco_markers/.gitignore @@ -0,0 +1,2 @@ +*.png +*.jpg diff --git a/aruco_markers/generate_markers.sh b/aruco_markers/generate_markers.sh new file mode 100755 index 0000000..2d3fddd --- /dev/null +++ b/aruco_markers/generate_markers.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +echo "Generating 20 markers" +example_aruco_create_marker -d=3 --id=1 --ms=100 marker_4X4_1000_1.png +example_aruco_create_marker -d=3 --id=2 --ms=100 marker_4X4_1000_2.png +example_aruco_create_marker -d=3 --id=3 --ms=100 marker_4X4_1000_3.png +example_aruco_create_marker -d=3 --id=4 --ms=100 marker_4X4_1000_4.png +example_aruco_create_marker -d=3 --id=5 --ms=100 marker_4X4_1000_5.png +example_aruco_create_marker -d=3 --id=6 --ms=100 marker_4X4_1000_6.png +example_aruco_create_marker -d=3 --id=7 --ms=100 marker_4X4_1000_7.png +example_aruco_create_marker -d=3 --id=8 --ms=100 marker_4X4_1000_8.png +example_aruco_create_marker -d=3 --id=9 --ms=100 marker_4X4_1000_9.png +example_aruco_create_marker -d=3 --id=10 --ms=100 marker_4X4_1000_10.png +example_aruco_create_marker -d=3 --id=11 --ms=100 marker_4X4_1000_11.png +example_aruco_create_marker -d=3 --id=12 --ms=100 marker_4X4_1000_12.png +example_aruco_create_marker -d=3 --id=13 --ms=100 marker_4X4_1000_13.png +example_aruco_create_marker -d=3 --id=14 --ms=100 marker_4X4_1000_14.png +example_aruco_create_marker -d=3 --id=15 --ms=100 marker_4X4_1000_15.png +example_aruco_create_marker -d=3 --id=16 --ms=100 marker_4X4_1000_16.png +example_aruco_create_marker -d=3 --id=17 --ms=100 marker_4X4_1000_17.png +example_aruco_create_marker -d=3 --id=18 --ms=100 marker_4X4_1000_18.png +example_aruco_create_marker -d=3 --id=19 --ms=100 marker_4X4_1000_19.png +example_aruco_create_marker -d=3 --id=20 --ms=100 marker_4X4_1000_20.png diff --git a/aruco_markers/markers_board.odt b/aruco_markers/markers_board.odt new file mode 100644 index 0000000..088d205 Binary files /dev/null and b/aruco_markers/markers_board.odt differ diff --git a/aruco_markers/markers_board.pdf b/aruco_markers/markers_board.pdf new file mode 100644 index 0000000..d65a9c7 Binary files /dev/null and b/aruco_markers/markers_board.pdf differ diff --git a/software/monitor/monitor/Client.cs b/software/monitor/monitor/Client.cs index a611b4c..688a223 100644 --- a/software/monitor/monitor/Client.cs +++ b/software/monitor/monitor/Client.cs @@ -62,20 +62,10 @@ namespace monitor /// private static byte[] buffer = new byte[BufferMaxSize]; - /// - /// buffer containing received message from TCP server - /// Used to concatenate internal buffers into one - /// - //private static byte[] receiveBuffer; - - //private static int initialReceiveBufferIndex = 0; - /// /// String containing received message from tcp server /// private static StringBuilder message = new StringBuilder(); - //private static int newLength = 1; - //private static int packetCounter = 0; /// /// Callback to send received message to upper level @@ -117,11 +107,6 @@ namespace monitor // received data are stored in buffer // Next reading will be done in ReadCallback method stream.BeginRead(buffer, 0, 1, new AsyncCallback(ReadCallback), message); - - // Start reading thread - //message.Clear(); - //readThread = new Thread(new ThreadStart(ReadCallback)); - //readThread.Start(); } catch (ArgumentNullException e) { @@ -207,7 +192,6 @@ namespace monitor { string s = message.ToString(); - //Console.WriteLine("Message received (" + s.Length + ")"); // no more data to read, buffer and string can be send to upper level readEvent?.Invoke(s); @@ -215,9 +199,6 @@ namespace monitor if (index != bytesRead - 1) { - //Console.WriteLine("Index not at end (" + index + "/" + bytesRead + ")"); - //Console.WriteLine("1=" + (char)buffer[index + 1] + " 2=" + (char)buffer[index + 2]); - byte[] trailing=new byte[BufferMaxSize]; Array.Copy(buffer, index + 1, trailing, 0, bytesRead - index - 1); diff --git a/software/monitor/monitor/DestijlCommandManager.cs b/software/monitor/monitor/DestijlCommandManager.cs index 3257eb8..84b1bb9 100644 --- a/software/monitor/monitor/DestijlCommandManager.cs +++ b/software/monitor/monitor/DestijlCommandManager.cs @@ -19,6 +19,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// 15/01/2019 dimercur +// Demande #41: Modifier les messages envoyés par les flèches de direction + using System; using System.Globalization; @@ -65,49 +68,8 @@ namespace monitor public const string ROBOT_CURRENT_STATE = "RCST"; public const char SEPARATOR_CHAR = ':'; - - //public const string HeaderMtsComDmb = "COM"; - //public const string HeaderMtsDmbOrder = "DMB"; - //public const string HeaderMtsCamera = "CAM"; - //public const string HeaderMtsMessage = "MSG"; - - //public const string DataComOpen = "o"; - //public const string DataComClose = "C"; - - //public const string DataCamOpen = "A"; - //public const string DataCamClose = "I"; - //public const string DataCamAskArena = "y"; - //public const string DataCamArenaConfirm = "x"; - //public const string DataCamInfirm = "z"; - //public const string DataCamComputePosition = "p"; - //public const string DataCamStopComputePosition = "s"; - - //public const string HeaderStmAck = "ACK"; - //public const string HeaderStmNoAck = "NAK"; - //public const string HeaderStmLostDmb = "LCD"; - //public const string HeaderStmImage = "IMG"; - //public const string HeaderStmPos = "POS"; - //public const string HeaderStmMes = "MSG"; - //public const string HeaderStmBat = "BAT"; } - /// - /// Commands used for robot messages - /// - //public static class RobotCommandList - //{ - // public const string RobotPing = "p"; - // public const string RobotReset = "r"; - // public const string RobotStartWithoutWatchdog = "u"; - // public const string RobotStartWithWatchdog = "W"; - // public const string RobotGetBattery = "v"; - // public const string RobotGetBusyState = "b"; - // public const string RobotMove = "M"; - // public const string RobotTurn = "T"; - // public const string RobotGetVersion = "V"; - // public const string RobotPowerOff = "z"; - //} - /// /// Specialization class for command manager, which implemnent destijl protocol between monitor and server /// @@ -409,17 +371,84 @@ namespace monitor } /// - /// Move robot forward or backward, for a distance expressed in millimeter + /// Move robot forward for an unlimited distance /// /// Command status (see DecodeStatus) - /// Distance of mouvment, in millimeter - public CommandStatus RobotMove(int distance) + public CommandStatus RobotGoForward() { CommandManager.CommandManagerStatus localStatus; string answer; localStatus = commandManager.SendCommand( - CreateCommand(DestijlCommandList.ROBOT_MOVE, Convert.ToString(distance)), + CreateCommand(DestijlCommandList.ROBOT_GO_FORWARD), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + /// + /// Move robot backward for an unlimited distance + /// + /// Command status (see DecodeStatus) + public CommandStatus RobotGoBackward() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.ROBOT_GO_BACKWARD), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + /// + /// Turn robot to the left for an unlimited number of turn + /// + /// Command status (see DecodeStatus) + public CommandStatus RobotGoLeft() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.ROBOT_GO_LEFT), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + /// + /// Turn robot to the right for an unlimited number of turn + /// + /// Command status (see DecodeStatus) + public CommandStatus RobotGoRight() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.ROBOT_GO_RIGHT), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + /// + /// Stop robot mouvement + /// + /// Command status (see DecodeStatus) + public CommandStatus RobotStop() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.ROBOT_STOP), out answer, 0); @@ -609,10 +638,6 @@ namespace monitor string[] parts = data.Split(';'); - //for (int i = 0; i < parts.Length; i++) { - // Console.WriteLine(parts[i]); - //} - NumberFormatInfo provider = new NumberFormatInfo(); provider.NumberDecimalSeparator = "."; provider.NumberGroupSeparator = ","; diff --git a/software/monitor/monitor/ImageWidget.cs b/software/monitor/monitor/ImageWidget.cs new file mode 100644 index 0000000..05b4a20 --- /dev/null +++ b/software/monitor/monitor/ImageWidget.cs @@ -0,0 +1,304 @@ +// +// ImageWidget.cs +// +// Author: +// Di MERCURIO Sébastien +// +// Copyright (c) 2019 INSA - DGEI +// +// This program 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. +// +// This program 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 this program. If not, see . + +// 15/10/2019 dimercur +// Demande #43: Migrer le code lié à la gestion des images dans sa propre classe widget + +using System; +using Gtk; +using Cairo; +using Gdk; + +using System.Timers; + +namespace monitor +{ + /// + /// Class used for video display + /// + public class ImageWidget + { + /// + /// Reference to GTK base widget + /// + private DrawingArea drawingArea; + + /// + /// Pixbuffer used for displaying image + /// + private Pixbuf drawingareaCameraPixbuf; + + /// + /// Indicate if position must be displayed or not + /// + public bool showPosition; + + /// + /// Indicate if FPS must be displayed or not + /// + private bool showFPS; + public bool ShowFPS + { + get + { + return showFPS; + } + + set + { + showFPS = value; + + if (value == true) + { + imageFPS = 0; + imageFPScounter = 0; + + fpsTimer.Start(); + } + else + { + fpsTimer.Stop(); + + Refresh(); + } + } + } + + /// + /// Counter used for FPS computation + /// + private int imageFPS = 0; + private int imageFPScounter = 0; + + /// + /// Timer for FPS request + /// + private System.Timers.Timer fpsTimer; + + /// + /// Hold position to be displayed + /// + private DestijlCommandManager.Position position; + public DestijlCommandManager.Position Position + { + get + { + return position; + } + + set + { + position = value; + Refresh(); + } + } + + /// + /// Request a refresh of drawing area + /// + private void Refresh() + { + Gtk.Application.Invoke(delegate + { + drawingArea.QueueDraw(); + }); + } + + /// + /// Initializes a new instance of ImageWidget class. + /// + /// Reference to GTK drawing area widget + public ImageWidget(DrawingArea area) + { + this.drawingArea = area; + // create new timer for FPS , every 1s + fpsTimer = new System.Timers.Timer(1000.0); + fpsTimer.Elapsed += OnFpsTimerElapsed; + + showPosition = false; + showFPS = false; + + drawingArea.ExposeEvent += OnDrawingAreaCameraExposeEvent; + } + + /// + /// Show an image from a ressource + /// + /// Ressource path + public void ShowImage(string ressource) + { + drawingareaCameraPixbuf = Pixbuf.LoadFromResource("monitor.ressources.missing_picture.png"); + imageFPScounter++; + + Refresh(); + } + + /// + /// Show an image from a byte array + /// + /// Byte array containing a valid image + public void ShowImage(byte[] image) + { + drawingareaCameraPixbuf = new Pixbuf(image); + imageFPScounter++; + + Refresh(); + } + + /// + /// Callback called when drawingarea need refresh + /// + /// Sender object + /// Expose arguments + protected void OnDrawingAreaCameraExposeEvent(object o, ExposeEventArgs args) + { + //Console.WriteLine("Event expose. Args = " + args.ToString()); + + DrawingArea area = (DrawingArea)o; + Gdk.Pixbuf displayPixbuf; + int areaWidth, areaHeight; + + // Get graphic context for background + Gdk.GC gc = area.Style.BackgroundGC(Gtk.StateType.Normal); + + // get size of drawingarea widget + area.GdkWindow.GetSize(out areaWidth, out areaHeight); + int width = drawingareaCameraPixbuf.Width; + int height = drawingareaCameraPixbuf.Height; + float ratio = (float)width / (float)height; + + // if widget is smaller than image, reduce it + if (areaWidth <= width) + { + width = areaWidth; + height = (int)(width / ratio); + } + + // if image is smaller than widget, enlarge it + if (width > areaWidth) + { + width = areaWidth; + } + + if (height > areaHeight) + { + height = areaHeight; + } + + //scale original picture and copy result in local pixbuf + displayPixbuf = drawingareaCameraPixbuf.ScaleSimple(width, height, InterpType.Bilinear); + + // draw local pixbuff centered on drawingarea + area.GdkWindow.DrawPixbuf(gc, displayPixbuf, + 0, 0, + (areaWidth - displayPixbuf.Width) / 2, + (areaHeight - displayPixbuf.Height) / 2, + displayPixbuf.Width, displayPixbuf.Height, + RgbDither.Normal, 0, 0); + + if (showPosition) + { + Cairo.Context cr = Gdk.CairoHelper.Create(area.GdkWindow); + Cairo.Color textFontColor = new Cairo.Color(0.8, 0, 0); + + cr.SelectFontFace("Cantarell", FontSlant.Normal, FontWeight.Bold); + cr.SetSourceColor(textFontColor); + cr.SetFontSize(16); + + if (position != null) + { + double space = 0.0; + + string text = "Direction (" + position.direction.x.ToString("0.##") + " ; " + position.direction.y.ToString("0.##") + ")"; + TextExtents te = cr.TextExtents(text); + cr.MoveTo(areaWidth - te.Width - 5, + areaHeight - te.Height - 5); + space = te.Height; + cr.ShowText(text); + + text = "Centre (" + position.centre.x.ToString("0.##") + " ; " + position.centre.y.ToString("0.##") + ")"; + te = cr.TextExtents(text); + cr.MoveTo(areaWidth - te.Width - 5, + areaHeight - te.Height - 5 - space - 5); + space = space + te.Height + 5; + cr.ShowText(text); + + text = "Angle: " + position.angle.ToString("0.##"); + te = cr.TextExtents(text); + cr.MoveTo(areaWidth - te.Width - 5, + areaHeight - te.Height - 5 - space - 5); + space = space + te.Height + 5; + cr.ShowText(text); + + text = "ID: " + position.robotID; + te = cr.TextExtents(text); + cr.MoveTo(areaWidth - te.Width - 5, + areaHeight - te.Height - 5 - space - 5); + + cr.ShowText(text); + } + else + { + string text = "Position (NULL)"; + TextExtents te = cr.TextExtents(text); + cr.MoveTo(areaWidth - te.Width - 5, + areaHeight - te.Height - 5); + + cr.ShowText(text); + } + + ((IDisposable)cr.GetTarget()).Dispose(); + ((IDisposable)cr).Dispose(); + } + + if (showFPS) + { + Cairo.Context cr = Gdk.CairoHelper.Create(area.GdkWindow); + Cairo.Color textFontColor = new Cairo.Color(0.8, 0, 0); + + cr.SelectFontFace("Cantarell", FontSlant.Normal, FontWeight.Bold); + cr.SetSourceColor(textFontColor); + cr.SetFontSize(16); + + string text = "FPS= " + imageFPS.ToString(); + TextExtents te = cr.TextExtents(text); + cr.MoveTo(10, 10 + te.Height); + cr.ShowText(text); + + ((IDisposable)cr.GetTarget()).Dispose(); + ((IDisposable)cr).Dispose(); + } + } + + /// + /// Timer used for FPS computation + /// + /// Sender object + /// unused parameter + private void OnFpsTimerElapsed(object sender, ElapsedEventArgs e) + { + imageFPS = imageFPScounter; + imageFPScounter = 0; + + Refresh(); + } + } +} diff --git a/software/monitor/monitor/MonitorUI.cs b/software/monitor/monitor/MonitorUI.cs index eb4a5b1..f2f43e0 100644 --- a/software/monitor/monitor/MonitorUI.cs +++ b/software/monitor/monitor/MonitorUI.cs @@ -19,6 +19,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// 15/01/2019 dimercur +// Demande #41: Modifier les messages envoyés par les flèches de direction + +// 15/10/2019 dimercur +// Demande #43: Migrer le code lié à la gestion des images dans sa propre classe widget using System; using Gtk; @@ -38,11 +43,6 @@ public partial class MainWindow : Gtk.Window /// private DestijlCommandManager cmdManager; - /// - /// Pixbuffer used for displaying image - /// - private Pixbuf drawingareaCameraPixbuf; - /// /// Position used for displaying position /// @@ -63,20 +63,21 @@ public partial class MainWindow : Gtk.Window /// private SystemState systemState = SystemState.NotConnected; + /// + /// Object used for displaying image on a valid DrawingArea widget + /// + private ImageWidget imageWidget; + /// /// Timer for battery request /// private System.Timers.Timer batteryTimer; + /// + /// Counter for image reception and detecting bad picture ratio + /// private int imageReceivedCounter = 0; private int badImageReceivedCounter = 0; - private int imageFPS = 0; - private int imageFPScounter = 0; - - /// - /// Timer for FPS request - /// - private System.Timers.Timer fpsTimer; /// /// Initializes a new instance of the class. @@ -87,14 +88,13 @@ public partial class MainWindow : Gtk.Window cmdManager = new DestijlCommandManager(OnCommandReceivedEvent); + // Init of image widget + imageWidget = new ImageWidget(drawingAreaCamera); + // create new timer for battery request, every 10s batteryTimer = new System.Timers.Timer(10000.0); batteryTimer.Elapsed += OnBatteryTimerElapsed; - // create new timer for FPS , every 1s - fpsTimer = new System.Timers.Timer(1000.0); - fpsTimer.Elapsed += OnFpsTimerElapsed; - // Customize controls AdjustControls(); } @@ -108,7 +108,7 @@ public partial class MainWindow : Gtk.Window ChangeState(SystemState.NotConnected); // Load "no picture" image from disque - drawingareaCameraPixbuf = Pixbuf.LoadFromResource("monitor.ressources.missing_picture.png"); + imageWidget.ShowImage("monitor.ressources.missing_picture.png"); // setup server controls entryServerName.Text = Client.defaultIP; @@ -140,6 +140,9 @@ public partial class MainWindow : Gtk.Window checkButtonRobotPosition.Active = false; checkButtonFPS.Active = false; + imageWidget.ShowFPS = false; + imageWidget.showPosition = false; + if (cmdManager != null) cmdManager.Close(); batteryTimer.Stop(); @@ -181,6 +184,9 @@ public partial class MainWindow : Gtk.Window checkButtonRobotPosition.Active = false; checkButtonFPS.Active = false; + imageWidget.ShowFPS = false; + imageWidget.showPosition = false; + systemState = SystemState.NotConnected; return; @@ -295,13 +301,7 @@ public partial class MainWindow : Gtk.Window try { - drawingareaCameraPixbuf = new Pixbuf(image); - imageFPScounter++; - - Gtk.Application.Invoke(delegate - { - drawingAreaCamera.QueueDraw(); - }); + imageWidget.ShowImage(image); } catch (GLib.GException) { @@ -316,12 +316,7 @@ public partial class MainWindow : Gtk.Window } else if (header == DestijlCommandList.CAMERA_POSITION) { - position = DestijlCommandManager.DecodePosition(data); - - Gtk.Application.Invoke(delegate - { - drawingAreaCamera.QueueDraw(); - }); + imageWidget.Position = DestijlCommandManager.DecodePosition(data); } } } @@ -336,6 +331,7 @@ public partial class MainWindow : Gtk.Window Console.WriteLine("Bye bye 2"); if (cmdManager != null) cmdManager.Close(); this.Destroy(); + Application.Quit(); } @@ -506,19 +502,23 @@ public partial class MainWindow : Gtk.Window // depending on button clicked, launch appropriate action if (sender == buttonRight) { - cmdManager.RobotTurn(90); + cmdManager.RobotGoRight(); } else if (sender == buttonLeft) { - cmdManager.RobotTurn(-90); + cmdManager.RobotGoLeft(); } else if (sender == buttonForward) { - cmdManager.RobotMove(100); + cmdManager.RobotGoForward(); } else if (sender == buttonDown) { - cmdManager.RobotMove(-100); + cmdManager.RobotGoBackward(); + } + else if (sender == buttonStop) + { + cmdManager.RobotStop(); } else { @@ -622,116 +622,8 @@ public partial class MainWindow : Gtk.Window //checkButtonRobotPosition.Active = false; } } - } - /// - /// Callback called when drawingarea need refresh - /// - /// Sender object - /// Expose arguments - protected void OnDrawingAreaCameraExposeEvent(object o, ExposeEventArgs args) - { - //Console.WriteLine("Event expose. Args = " + args.ToString()); - - DrawingArea area = (DrawingArea)o; - Gdk.Pixbuf displayPixbuf; - int areaWidth, areaHeight; - - // Get graphic context for background - Gdk.GC gc = area.Style.BackgroundGC(Gtk.StateType.Normal); - - // get size of drawingarea widget - area.GdkWindow.GetSize(out areaWidth, out areaHeight); - int width = drawingareaCameraPixbuf.Width; - int height = drawingareaCameraPixbuf.Height; - float ratio = (float)width / (float)height; - - // if widget is smaller than image, reduce it - if (areaWidth <= width) - { - width = areaWidth; - height = (int)(width / ratio); - } - - // if image is smaller than widget, enlarge it - if (width > areaWidth) - { - width = areaWidth; - } - - if (height > areaHeight) - { - height = areaHeight; - } - - //scale original picture and copy result in local pixbuf - displayPixbuf = drawingareaCameraPixbuf.ScaleSimple(width, height, InterpType.Bilinear); - - // draw local pixbuff centered on drawingarea - area.GdkWindow.DrawPixbuf(gc, displayPixbuf, - 0, 0, - (areaWidth - displayPixbuf.Width) / 2, - (areaHeight - displayPixbuf.Height) / 2, - displayPixbuf.Width, displayPixbuf.Height, - RgbDither.Normal, 0, 0); - - if (checkButtonRobotPosition.Active) { - Cairo.Context cr = Gdk.CairoHelper.Create(area.GdkWindow); - Cairo.Color textFontColor = new Cairo.Color(0.8, 0, 0); - - cr.SelectFontFace("Cantarell", FontSlant.Normal, FontWeight.Bold); - cr.SetSourceColor(textFontColor); - cr.SetFontSize(16); - - double space = 0.0; - string text = "Direction (" + position.direction.x.ToString("0.##") + " ; " + position.direction.y.ToString("0.##") +")"; - TextExtents te = cr.TextExtents(text); - cr.MoveTo(areaWidth - te.Width-5, - areaHeight - te.Height -5); - space = te.Height; - cr.ShowText(text); - - text = "Centre (" + position.centre.x.ToString("0.##") + " ; " + position.centre.y.ToString("0.##") + ")"; - te = cr.TextExtents(text); - cr.MoveTo(areaWidth - te.Width - 5, - areaHeight - te.Height - 5 - space-5); - space = space+ te.Height+5; - cr.ShowText(text); - - text = "Angle: " + position.angle.ToString("0.##"); - te = cr.TextExtents(text); - cr.MoveTo(areaWidth - te.Width - 5, - areaHeight - te.Height - 5 - space - 5); - space = space+ te.Height+5; - cr.ShowText(text); - - text = "ID: " + position.robotID; - te = cr.TextExtents(text); - cr.MoveTo(areaWidth - te.Width - 5, - areaHeight - te.Height - 5 - space-5); - - cr.ShowText(text); - - ((IDisposable)cr.GetTarget()).Dispose(); - ((IDisposable)cr).Dispose(); - } - - if (checkButtonFPS.Active) { - Cairo.Context cr = Gdk.CairoHelper.Create(area.GdkWindow); - Cairo.Color textFontColor = new Cairo.Color(0.8, 0, 0); - - cr.SelectFontFace("Cantarell", FontSlant.Normal, FontWeight.Bold); - cr.SetSourceColor(textFontColor); - cr.SetFontSize(16); - - string text = "FPS= " + imageFPS.ToString() ; - TextExtents te = cr.TextExtents(text); - cr.MoveTo( 10,10 + te.Height); - cr.ShowText(text); - - ((IDisposable)cr.GetTarget()).Dispose(); - ((IDisposable)cr).Dispose(); - } + imageWidget.showPosition = checkButtonRobotPosition.Active; } /// @@ -766,7 +658,7 @@ public partial class MainWindow : Gtk.Window } /// - /// Callback called when "detect Arena " button is clicked + /// Callback called when "Detect Arena" button is clicked /// /// Sender object /// Event @@ -785,32 +677,13 @@ public partial class MainWindow : Gtk.Window DetectArena(); } + /// + /// Callback function for FPS checkbutton + /// + /// Sender object + /// unused paramter protected void OnCheckButtonFPSToggled(object sender, EventArgs e) { - if (checkButtonFPS.Active) { // User ask for FPS - imageFPS = 0; - imageFPScounter = 0; - - fpsTimer.Start(); - } - else { // stop computing FPS - fpsTimer.Stop(); - - Gtk.Application.Invoke(delegate - { - drawingAreaCamera.QueueDraw(); - }); - } - } - - private void OnFpsTimerElapsed(object sender, ElapsedEventArgs e) - { - imageFPS = imageFPScounter; - imageFPScounter = 0; - - Gtk.Application.Invoke(delegate - { - drawingAreaCamera.QueueDraw(); - }); + imageWidget.ShowFPS = checkButtonFPS.Active; } } diff --git a/software/monitor/monitor/gtk-gui/MainWindow.cs b/software/monitor/monitor/gtk-gui/MainWindow.cs index 8885971..466b549 100644 --- a/software/monitor/monitor/gtk-gui/MainWindow.cs +++ b/software/monitor/monitor/gtk-gui/MainWindow.cs @@ -117,6 +117,8 @@ public partial class MainWindow private global::Gtk.Button buttonRight; + private global::Gtk.Button buttonStop; + private global::Gtk.Table table3; private global::Gtk.Label label3; @@ -528,70 +530,92 @@ public partial class MainWindow this.table4.ColumnSpacing = ((uint)(6)); // Container child table4.Gtk.Table+TableChild this.buttonDown = new global::Gtk.Button(); + global::Gtk.Tooltips w40 = new Gtk.Tooltips(); + w40.SetTip(this.buttonDown, "Move robot backward", "Move robot backward"); this.buttonDown.CanFocus = true; this.buttonDown.Name = "buttonDown"; this.buttonDown.UseUnderline = true; - global::Gtk.Image w40 = new global::Gtk.Image(); - w40.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-down-symbolic.symbolic.png"); - this.buttonDown.Image = w40; + global::Gtk.Image w41 = new global::Gtk.Image(); + w41.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-down-symbolic.symbolic.png"); + this.buttonDown.Image = w41; this.table4.Add(this.buttonDown); - global::Gtk.Table.TableChild w41 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonDown])); - w41.TopAttach = ((uint)(2)); - w41.BottomAttach = ((uint)(3)); - w41.LeftAttach = ((uint)(1)); - w41.RightAttach = ((uint)(2)); - w41.XOptions = ((global::Gtk.AttachOptions)(4)); - w41.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w42 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonDown])); + w42.TopAttach = ((uint)(2)); + w42.BottomAttach = ((uint)(3)); + w42.LeftAttach = ((uint)(1)); + w42.RightAttach = ((uint)(2)); + w42.XOptions = ((global::Gtk.AttachOptions)(4)); + w42.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild this.buttonForward = new global::Gtk.Button(); + w40.SetTip(this.buttonForward, "Move robot forward", "Move robot forward"); this.buttonForward.CanFocus = true; this.buttonForward.Name = "buttonForward"; this.buttonForward.UseUnderline = true; - global::Gtk.Image w42 = new global::Gtk.Image(); - w42.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-up-symbolic.symbolic.png"); - this.buttonForward.Image = w42; + global::Gtk.Image w43 = new global::Gtk.Image(); + w43.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-up-symbolic.symbolic.png"); + this.buttonForward.Image = w43; this.table4.Add(this.buttonForward); - global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonForward])); - w43.LeftAttach = ((uint)(1)); - w43.RightAttach = ((uint)(2)); - w43.XOptions = ((global::Gtk.AttachOptions)(4)); - w43.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w44 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonForward])); + w44.LeftAttach = ((uint)(1)); + w44.RightAttach = ((uint)(2)); + w44.XOptions = ((global::Gtk.AttachOptions)(4)); + w44.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild this.buttonLeft = new global::Gtk.Button(); + w40.SetTip(this.buttonLeft, "Turn robot to the left", "Turn robot to the left"); this.buttonLeft.CanFocus = true; this.buttonLeft.Name = "buttonLeft"; this.buttonLeft.UseUnderline = true; - global::Gtk.Image w44 = new global::Gtk.Image(); - w44.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-start-symbolic.symbolic.png"); - this.buttonLeft.Image = w44; + global::Gtk.Image w45 = new global::Gtk.Image(); + w45.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-start-symbolic.symbolic.png"); + this.buttonLeft.Image = w45; this.table4.Add(this.buttonLeft); - global::Gtk.Table.TableChild w45 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonLeft])); - w45.TopAttach = ((uint)(1)); - w45.BottomAttach = ((uint)(2)); - w45.XOptions = ((global::Gtk.AttachOptions)(4)); - w45.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w46 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonLeft])); + w46.TopAttach = ((uint)(1)); + w46.BottomAttach = ((uint)(2)); + w46.XOptions = ((global::Gtk.AttachOptions)(4)); + w46.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild this.buttonRight = new global::Gtk.Button(); + w40.SetTip(this.buttonRight, "Turn robot to the right", "Turn robot to the right"); this.buttonRight.CanFocus = true; this.buttonRight.Name = "buttonRight"; this.buttonRight.UseUnderline = true; - global::Gtk.Image w46 = new global::Gtk.Image(); - w46.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-end-symbolic.symbolic.png"); - this.buttonRight.Image = w46; + global::Gtk.Image w47 = new global::Gtk.Image(); + w47.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-end-symbolic.symbolic.png"); + this.buttonRight.Image = w47; this.table4.Add(this.buttonRight); - global::Gtk.Table.TableChild w47 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonRight])); - w47.TopAttach = ((uint)(1)); - w47.BottomAttach = ((uint)(2)); - w47.LeftAttach = ((uint)(2)); - w47.RightAttach = ((uint)(3)); - w47.XOptions = ((global::Gtk.AttachOptions)(4)); - w47.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w48 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonRight])); + w48.TopAttach = ((uint)(1)); + w48.BottomAttach = ((uint)(2)); + w48.LeftAttach = ((uint)(2)); + w48.RightAttach = ((uint)(3)); + w48.XOptions = ((global::Gtk.AttachOptions)(4)); + w48.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table4.Gtk.Table+TableChild + this.buttonStop = new global::Gtk.Button(); + w40.SetTip(this.buttonStop, "Stop robot movements", "Stop robot movements"); + this.buttonStop.CanFocus = true; + this.buttonStop.Name = "buttonStop"; + this.buttonStop.UseUnderline = true; + global::Gtk.Image w49 = new global::Gtk.Image(); + w49.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.hand-filled-32.png"); + this.buttonStop.Image = w49; + this.table4.Add(this.buttonStop); + global::Gtk.Table.TableChild w50 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonStop])); + w50.TopAttach = ((uint)(1)); + w50.BottomAttach = ((uint)(2)); + w50.LeftAttach = ((uint)(1)); + w50.RightAttach = ((uint)(2)); + w50.XOptions = ((global::Gtk.AttachOptions)(4)); + w50.YOptions = ((global::Gtk.AttachOptions)(4)); this.alignment8.Add(this.table4); this.vbox9.Add(this.alignment8); - global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.alignment8])); - w49.Position = 0; - w49.Expand = false; - w49.Fill = false; + global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.alignment8])); + w52.Position = 0; + w52.Expand = false; + w52.Fill = false; // Container child vbox9.Gtk.Box+BoxChild this.table3 = new global::Gtk.Table(((uint)(1)), ((uint)(2)), false); this.table3.Name = "table3"; @@ -604,10 +628,10 @@ public partial class MainWindow this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Battery level:"); this.label3.Justify = ((global::Gtk.Justification)(1)); this.table3.Add(this.label3); - global::Gtk.Table.TableChild w50 = ((global::Gtk.Table.TableChild)(this.table3[this.label3])); - w50.YPadding = ((uint)(10)); - w50.XOptions = ((global::Gtk.AttachOptions)(4)); - w50.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w53 = ((global::Gtk.Table.TableChild)(this.table3[this.label3])); + w53.YPadding = ((uint)(10)); + w53.XOptions = ((global::Gtk.AttachOptions)(4)); + w53.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table3.Gtk.Table+TableChild this.labelBatteryLevel = new global::Gtk.Label(); this.labelBatteryLevel.Name = "labelBatteryLevel"; @@ -615,15 +639,15 @@ public partial class MainWindow this.labelBatteryLevel.Xalign = 0F; this.labelBatteryLevel.LabelProp = global::Mono.Unix.Catalog.GetString("Unknown"); this.table3.Add(this.labelBatteryLevel); - global::Gtk.Table.TableChild w51 = ((global::Gtk.Table.TableChild)(this.table3[this.labelBatteryLevel])); - w51.LeftAttach = ((uint)(1)); - w51.RightAttach = ((uint)(2)); - w51.YOptions = ((global::Gtk.AttachOptions)(4)); + global::Gtk.Table.TableChild w54 = ((global::Gtk.Table.TableChild)(this.table3[this.labelBatteryLevel])); + w54.LeftAttach = ((uint)(1)); + w54.RightAttach = ((uint)(2)); + w54.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox9.Add(this.table3); - global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.table3])); - w52.Position = 2; - w52.Expand = false; - w52.Fill = false; + global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.table3])); + w55.Position = 2; + w55.Expand = false; + w55.Fill = false; // Container child vbox9.Gtk.Box+BoxChild this.checkButtonGetBattery = new global::Gtk.CheckButton(); this.checkButtonGetBattery.CanFocus = true; @@ -633,31 +657,31 @@ public partial class MainWindow this.checkButtonGetBattery.DrawIndicator = true; this.checkButtonGetBattery.UseUnderline = true; this.vbox9.Add(this.checkButtonGetBattery); - global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.checkButtonGetBattery])); - w53.Position = 3; - w53.Expand = false; - w53.Fill = false; + global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.checkButtonGetBattery])); + w56.Position = 3; + w56.Expand = false; + w56.Fill = false; this.gtkAlignmentRobotControl.Add(this.vbox9); this.vbox12.Add(this.gtkAlignmentRobotControl); - global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.vbox12[this.gtkAlignmentRobotControl])); - w55.Position = 1; + global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.vbox12[this.gtkAlignmentRobotControl])); + w58.Position = 1; this.vbox5.Add(this.vbox12); - global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.vbox12])); - w56.Position = 4; + global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.vbox12])); + w59.Position = 4; this.alignment3.Add(this.vbox5); this.hbox3.Add(this.alignment3); - global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.alignment3])); - w58.Position = 1; - w58.Expand = false; - w58.Fill = false; + global::Gtk.Box.BoxChild w61 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.alignment3])); + w61.Position = 1; + w61.Expand = false; + w61.Fill = false; this.hbox1.Add(this.hbox3); - global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.hbox3])); - w59.Position = 1; - w59.Expand = false; - w59.Fill = false; + global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.hbox3])); + w62.Position = 1; + w62.Expand = false; + w62.Fill = false; this.vbox1.Add(this.hbox1); - global::Gtk.Box.BoxChild w60 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); - w60.Position = 1; + global::Gtk.Box.BoxChild w63 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); + w63.Position = 1; this.Add(this.vbox1); if ((this.Child != null)) { @@ -673,9 +697,9 @@ public partial class MainWindow this.checkButtonRobotPosition.Clicked += new global::System.EventHandler(this.OnCheckButtonRobotPositionClicked); this.checkButtonFPS.Toggled += new global::System.EventHandler(this.OnCheckButtonFPSToggled); this.buttonAskArena.Clicked += new global::System.EventHandler(this.OnButtonAskArenaClicked); - this.drawingAreaCamera.ExposeEvent += new global::Gtk.ExposeEventHandler(this.OnDrawingAreaCameraExposeEvent); this.buttonServerConnection.Clicked += new global::System.EventHandler(this.OnButtonServerConnectionClicked); this.buttonRobotActivation.Clicked += new global::System.EventHandler(this.OnButtonRobotActivationClicked); + this.buttonStop.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); this.buttonRight.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); this.buttonLeft.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); this.buttonForward.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); diff --git a/software/monitor/monitor/gtk-gui/gui.stetic b/software/monitor/monitor/gtk-gui/gui.stetic index 3b3cc1b..e29a0d4 100644 --- a/software/monitor/monitor/gtk-gui/gui.stetic +++ b/software/monitor/monitor/gtk-gui/gui.stetic @@ -170,7 +170,6 @@ - 1 @@ -610,12 +609,10 @@ - - - + Move robot backward True TextAndIcon resource:monitor.ressources.pan-down-symbolic.symbolic.png @@ -642,6 +639,7 @@ + Move robot forward True TextAndIcon resource:monitor.ressources.pan-up-symbolic.symbolic.png @@ -666,6 +664,7 @@ + Turn robot to the left True TextAndIcon resource:monitor.ressources.pan-start-symbolic.symbolic.png @@ -690,6 +689,7 @@ + Turn robot to the right True TextAndIcon resource:monitor.ressources.pan-end-symbolic.symbolic.png @@ -713,6 +713,33 @@ False + + + + Stop robot movements + True + TextAndIcon + resource:monitor.ressources.hand-filled-32.png + + True + + + + 1 + 2 + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + diff --git a/software/monitor/monitor/monitor b/software/monitor/monitor/monitor index f9eebc6..5cae4f9 100755 Binary files a/software/monitor/monitor/monitor and b/software/monitor/monitor/monitor differ diff --git a/software/monitor/monitor/monitor.csproj b/software/monitor/monitor/monitor.csproj index 760c5f1..7a8ee15 100644 --- a/software/monitor/monitor/monitor.csproj +++ b/software/monitor/monitor/monitor.csproj @@ -70,6 +70,7 @@ + @@ -80,6 +81,7 @@ + diff --git a/software/monitor/monitor/ressources/hand-filled-32.png b/software/monitor/monitor/ressources/hand-filled-32.png new file mode 100644 index 0000000..5f113cf Binary files /dev/null and b/software/monitor/monitor/ressources/hand-filled-32.png differ diff --git a/software/raspberry/superviseur-robot/.gitignore b/software/raspberry/superviseur-robot/.gitignore index 8ba92f7..1a533ec 100644 --- a/software/raspberry/superviseur-robot/.gitignore +++ b/software/raspberry/superviseur-robot/.gitignore @@ -9,3 +9,6 @@ Makefile *.cmake CMakeCache.txt +docs/ +doc/ + diff --git a/software/raspberry/superviseur-robot/CMakeLists.txt b/software/raspberry/superviseur-robot/CMakeLists.txt deleted file mode 100644 index c7d8880..0000000 --- a/software/raspberry/superviseur-robot/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -project(ProjDestijl CXX) - -set (ProjDestjil_VERSION_MAJOR 1) -set (ProjDestjil_VERSION_MINOR 0) -set (CMAKE_CXX_STANDARD 11) - -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/superviseur/bin) - -option(BUILD_FOR_XENOMAI "Build for Raspberry" OFF) - -set(CMAKE_BUILD_TYPE DEBUG) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy") - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed -lalchemy -lcopperplate /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=/usr/xenomai/lib/dynlist.ld -L/usr/xenomai/lib -lmercury -lpthread -lrt") - -add_subdirectory("lib") -#add_subdirectory("examples") -add_subdirectory("superviseur") - diff --git a/software/raspberry/superviseur-robot/ProjDestijl.cbp b/software/raspberry/superviseur-robot/ProjDestijl.cbp deleted file mode 100644 index 7ade805..0000000 --- a/software/raspberry/superviseur-robot/ProjDestijl.cbp +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - diff --git a/software/raspberry/superviseur-robot/compile_commands.json b/software/raspberry/superviseur-robot/compile_commands.json deleted file mode 100644 index e195bcd..0000000 --- a/software/raspberry/superviseur-robot/compile_commands.json +++ /dev/null @@ -1,32 +0,0 @@ -[ -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/. -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/destijl.dir/src/robot.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/robot.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/robot.cpp" -}, -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/. -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/destijl.dir/src/monitor.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/monitor.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/monitor.cpp" -}, -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/. -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/destijl.dir/src/message.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/message.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/message.cpp" -}, -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/. -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/destijl.dir/src/image.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/image.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/image.cpp" -}, -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/./src -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/../lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/superviseur.dir/src/main.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/main.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/main.cpp" -}, -{ - "directory": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur", - "command": "/usr/bin/g++ -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/./src -I/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/../lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D__MERCURY__ -I/usr/xenomai/include/alchemy -g3 -gdwarf-2 -std=gnu++11 -o CMakeFiles/superviseur.dir/src/functions.cpp.o -c /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/functions.cpp", - "file": "/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/functions.cpp" -} -] \ No newline at end of file diff --git a/software/raspberry/superviseur-robot/dist/Debug__Pthread_/GNU-Linux/superviseur-robot b/software/raspberry/superviseur-robot/dist/Debug__Pthread_/GNU-Linux/superviseur-robot index 631c6ae..bbd8453 100755 Binary files a/software/raspberry/superviseur-robot/dist/Debug__Pthread_/GNU-Linux/superviseur-robot and b/software/raspberry/superviseur-robot/dist/Debug__Pthread_/GNU-Linux/superviseur-robot differ diff --git a/software/raspberry/superviseur-robot/lib/CMakeLists.txt b/software/raspberry/superviseur-robot/lib/CMakeLists.txt deleted file mode 100644 index 318684e..0000000 --- a/software/raspberry/superviseur-robot/lib/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(LIB_FILES ./src/robot.cpp ./src/monitor.cpp ./src/message.cpp ./src/image.cpp) -include_directories("./") - -add_library(destijl STATIC ${LIB_FILES}) - diff --git a/software/raspberry/superviseur-robot/lib/camera.cpp b/software/raspberry/superviseur-robot/lib/camera.cpp index 94f27ba..c818673 100644 --- a/software/raspberry/superviseur-robot/lib/camera.cpp +++ b/software/raspberry/superviseur-robot/lib/camera.cpp @@ -1,4 +1,4 @@ - /* +/* * Copyright (C) 2018 dimercur * * This program is free software: you can redistribute it and/or modify @@ -21,48 +21,64 @@ using namespace cv; +/** + * Create an object for accessing camera + * @param size Size of picture to grab (@see captureSize) + * @param fps speed of sampling + */ Camera::Camera(int size, int fps) { this->SetSize(size); #ifndef __FOR_PC__ this->cap.set(CV_CAP_PROP_FORMAT, CV_8UC3); - this->cap.set(CV_CAP_PROP_FRAME_WIDTH,width); - this->cap.set(CV_CAP_PROP_FRAME_HEIGHT,height); + this->cap.set(CV_CAP_PROP_FRAME_WIDTH, width); + this->cap.set(CV_CAP_PROP_FRAME_HEIGHT, height); this->cap.set(CV_CAP_PROP_FPS, fps); #endif /* __FOR_PC__ */ } +/** + * Open camera + * @return True if camera is open, false otherwise + */ bool Camera::Open() { bool status = false; - + #ifdef __FOR_PC__ if (this->cap.open(0)) { //this->cap.set(CV_CAP_PROP_FORMAT, CV_8UC3); - this->cap.set(CV_CAP_PROP_FRAME_WIDTH,width); - this->cap.set(CV_CAP_PROP_FRAME_HEIGHT,height); - - status =true; - } + this->cap.set(CV_CAP_PROP_FRAME_WIDTH, width); + this->cap.set(CV_CAP_PROP_FRAME_HEIGHT, height); + + status = true; + } #else if (this->cap.open()) { - cout<<"Camera warmup 2sec"<cap.release(); } +/** + * Define size for sampled picture + * @param size Size of picture (@see captureSize) + */ void Camera::SetSize(int size) { this->size = size; - - switch (size){ + + switch (size) { case xs: this->width = 480; this->height = 360; @@ -85,33 +101,47 @@ void Camera::SetSize(int size) { } } +/** + * Grab next image from camera + * @return Image taken from camera + */ Img Camera::Grab() { ImageMat frame; - + #ifdef __FOR_PC__ cap >> frame; Img capture = Img(frame); #else cap.grab(); - cap.retrieve (frame); - cvtColor(frame,frame,CV_BGR2RGB); - + cap.retrieve(frame); + cvtColor(frame, frame, CV_BGR2RGB); + Img capture = Img(frame); #endif /* __FOR_PC__ */ - + return capture; } +/** + * Get opening status for camera + * @return true if camera is open, false otherwise + */ bool Camera::IsOpen() { return cap.isOpened(); } +/** + * Get width of sampled image + * @return Width of sampled picture + */ int Camera::GetWidth() const { return width; } +/** + * Get height of sampled image + * @return height of sampled picture + */ int Camera::GetHeight() const { return height; } - - diff --git a/software/raspberry/superviseur-robot/lib/camera.h b/software/raspberry/superviseur-robot/lib/camera.h index df26e68..1d06f9f 100644 --- a/software/raspberry/superviseur-robot/lib/camera.h +++ b/software/raspberry/superviseur-robot/lib/camera.h @@ -26,32 +26,89 @@ #endif /* __FOR_PC__ */ #include "img.h" +/** + * Enumerate for picture size + */ enum captureSize {xs, sm, md, lg}; +/** + * Class for camera (image grab) + * + * @brief Class for camera (image grab) + */ class Camera { public: + /** + * Create an object for accessing camera + * @param size Size of picture to grab (@see captureSize) + * @param fps speed of sampling + */ Camera(int size, int fps); + /** + * Open camera + * @return True if camera is open, false otherwise + */ bool Open(); + + /** + * Close and release camera + */ void Close(); + /** + * Get width of sampled image + * @return Width of sampled picture + */ int GetWidth() const; + + /** + * Get height of sampled image + * @return height of sampled picture + */ int GetHeight() const; + /** + * Get opening status for camera + * @return true if camera is open, false otherwise + */ bool IsOpen(); + + /** + * Define size for sampled picture + * @param size Size of picture (@see captureSize) + */ void SetSize(int size); + /** + * Grab next image from camera + * @return Image taken from camera + */ Img Grab(); private: #ifdef __FOR_PC__ + /** + * Camera descriptor + */ cv::VideoCapture cap; #else raspicam::RaspiCam_Cv cap; #endif /* __FOR_PC__ */ + /** + * Size for image (default= small) + */ int size = sm; + + /** + * Width of image + */ int width; + + /** + * Height of image + */ int height; }; diff --git a/software/raspberry/superviseur-robot/lib/commonitor.cpp b/software/raspberry/superviseur-robot/lib/commonitor.cpp index a7360a8..e5bdd60 100644 --- a/software/raspberry/superviseur-robot/lib/commonitor.cpp +++ b/software/raspberry/superviseur-robot/lib/commonitor.cpp @@ -339,6 +339,8 @@ Message *ComMonitor::StringToMessage(string &s) { msg = new Message(MESSAGE_ROBOT_GO_LEFT); } else if (tokenCmd.find(LABEL_MONITOR_ROBOT_GO_RIGHT) != string::npos) { msg = new Message(MESSAGE_ROBOT_GO_RIGHT); + } else if (tokenCmd.find(LABEL_MONITOR_ROBOT_STOP) != string::npos) { + msg = new Message(MESSAGE_ROBOT_STOP); } else if (tokenCmd.find(LABEL_MONITOR_ROBOT_POWEROFF) != string::npos) { msg = new Message(MESSAGE_ROBOT_POWEROFF); } else { diff --git a/software/raspberry/superviseur-robot/lib/definitions.h b/software/raspberry/superviseur-robot/lib/definitions.h deleted file mode 100644 index ff9bc16..0000000 --- a/software/raspberry/superviseur-robot/lib/definitions.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file definitions.h - * \author PE.Hladik - * \version 1.0 - * \date 06/06/2017 - * \brief Various constants used in destjil project - */ - - -#ifndef DEFINITIONS_H -#define DEFINITIONS_H - -#define OPEN_COM_DMB 'o' -#define CLOSE_COM_DMB 'C' - -#define DMB_PING 'p' -#define DMB_IDLE 'r' -#define DMB_START_WITHOUT_WD 'u' -#define DMB_START_WITH_WD 'W' -#define DMB_RELOAD_WD 'w' -#define DMB_GET_VBAT 'v' -#define DMB_IS_BUSY 'b' -#define DMB_MOVE 'M' -#define DMB_TURN 'T' -#define DMB_GO_FORWARD 'F' -#define DMB_GO_BACK 'B' -#define DMB_GO_LEFT 'L' -#define DMB_GO_RIGHT 'R' -#define DMB_STOP_MOVE 'S' - -#define ROBOT_TIMED_OUT -3 -#define ROBOT_UKNOWN_CMD -2 -#define ROBOT_ERROR -1 -#define ROBOT_CHECKSUM -4 -#define ROBOT_OK 0 - -#define CAM_OPEN 'A' -#define CAM_CLOSE 'I' -#define CAM_ASK_ARENA 'y' -#define CAM_ARENA_CONFIRM 'x' -#define CAM_ARENA_INFIRM 'z' -#define CAM_COMPUTE_POSITION 'p' -#define CAM_STOP_COMPUTE_POSITION 's' - -#define DMB_BAT_LOW 0 -#define DMB_BAT_MEDIUM 1 -#define DMB_BAT_HIGH 2 - -#define DMB_BUSY 1 -#define DMB_DO_NOTHING 0 - -#endif /* MSG_H */ - diff --git a/software/raspberry/superviseur-robot/lib/image.cpp b/software/raspberry/superviseur-robot/lib/image.cpp deleted file mode 100644 index 5b18a0d..0000000 --- a/software/raspberry/superviseur-robot/lib/image.cpp +++ /dev/null @@ -1,260 +0,0 @@ - -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file image.cpp - * \author L.Senaneuch - * \version 1.0 - * \date 06/06/2017 - * \brief Fonctions de traitement d'image utilisable pour la détection du robot. - * - * \details Ce fichier utilise la libraire openCV2 pour faciliter le traitement d'image dans le projet Destijl. - * Il permet de faciliter la détection de l'arène et la détection du robot. - * /!\ Attention Bien que celui-ci soit un .cpp la structure du code n'est pas sous forme d'objet. - */ - -#include "image.h" -#include - -using namespace cv; -#ifndef __STUB__ -#ifdef __FOR_PC__ -VideoCapture cap; -#else -using namespace raspicam; -#endif /* __FOR_PC__ */ -#else -Image stubImg; - -#endif -using namespace std; - -float calculAngle(Position * positionRobot); -int cropArena(Image *imgInput, Image *imgOutput, Arene *AreneInput); -float euclideanDist(Point& p, Point& q); - -void draw_arena(Image *imgInput, Image *imgOutput, Arene *monArene) -{ - if(imgInput!=imgOutput) - *imgOutput=imgInput->clone(); - rectangle(*imgOutput,monArene->tl(),monArene->br(),Scalar(0,0,125),2,8,0); -} - -int open_camera(Camera *camera) -{ -#ifndef __STUB__ -#ifdef __FOR_PC__ - // open the default camera, use something different from 0 otherwise; - // Check VideoCapture documentation. - printf("Opening Camera...\n"); - if(!cap.open(0)) - return -1; - - return 0; -#else // for raspberry - - camera->set(CV_CAP_PROP_FORMAT, CV_8UC3); - camera->set(CV_CAP_PROP_FRAME_WIDTH,WIDTH); - camera->set(CV_CAP_PROP_FRAME_HEIGHT,HEIGHT); - - printf("Opening Camera...\n"); - if (!(camera->open())) { - perror("Can't open Camera\n") ; - return -1; - } - else - { - printf("Camera warmup 2sec\n"); - sleep(2); - printf("Start capture\n"); - return 0; - } -#endif /* __FOR_PC__ */ -#else - return 0; -#endif -} - -void get_image(Camera *camera, Image * monImage, const char * fichier) // getImg(Camera, Image img); -{ -#ifndef __STUB__ -#ifdef __FOR_PC__ - if (monImage != NULL) - { - cap>>*monImage; - } -#else // for raspberry - camera->grab(); - camera->retrieve(*monImage); - cvtColor(*monImage,*monImage,CV_BGR2RGB); -#endif /* __FOR_PC__ */ -#else - stubImg = imread(fichier, CV_LOAD_IMAGE_COLOR); - stubImg.copyTo(*monImage); -#endif -} - -void close_camera(Camera *camera) // closeCam(Camera) : camera Entrer -{ -#ifndef __STUB__ -#ifdef __FOR_PC__ - cap.release(); -#else // for raspberry - camera->release(); -#endif /* __FOR_PC__ */ -#else - -#endif -} - - -int detect_arena(Image *monImage, Arene *rectangle) // Image en entrée // rectangle en sortie -{ - vector > contours; - vector approx; - vector hierarchy; - - Image imageTrt; - cvtColor(*monImage,imageTrt,CV_RGB2GRAY); // conversion en niveau de gris - threshold(imageTrt,imageTrt,128,255,CV_THRESH_BINARY); // Threshold les éléments les plus clair - Canny(imageTrt, imageTrt, 100,200,3); // detection d'angle - - findContours(imageTrt, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0)); - for(unsigned int i = 0; i < contours.size();i++) - { - approxPolyDP(Image(contours[i]), approx, arcLength(Image(contours[i]), true)*0.1, true); - if(approx.size()==4 && fabs(cv::contourArea(contours[i])) > 100000) - { - *rectangle = boundingRect(Image(contours[i])); - return 0; - } - } - return -1; -} - -int cropArena(Image *imgInput, Image *imgOutput, Arene *areneInput) // image // rectangle // image2 -{ - Image img; - img=imgInput->clone(); - - *imgOutput = img(*areneInput); - return 0; -} - -float euclideanDist(Point& p, Point& q) { - Point diff = p - q; - return cv::sqrt(diff.x*diff.x + diff.y*diff.y); -} - -void compress_image(Image *imgInput, Jpg *imageCompress) // image entrée // imageEncodé en sortie -{ - imencode(".jpg",*imgInput,*imageCompress); -} - - -int detect_position(Image *imgInput, Position *posTriangle, Arene * monArene) // entree : image / sortie tab pos -{ - vector > contours; - vector approx; - vector hierarchy; - - Image imgTraitment; - - if(monArene==NULL) - imgTraitment=imgInput->clone(); - else - cropArena(imgInput,&imgTraitment, monArene); - - cvtColor(imgTraitment,imgTraitment,CV_RGB2GRAY); - threshold(imgTraitment,imgTraitment,128,255,CV_THRESH_BINARY); - findContours(imgTraitment, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0)); - - int nbrTriangle = 0; - for(unsigned int i = 0;i < contours.size();i++) - { - approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.17, true); - if(approx.size() == 3 && fabs(contourArea(contours[i])) > 200 && fabs(contourArea(contours[i])) < 700) - { - - Point a,b,c; - Point center; - - - a = approx[0]; - b = approx[1]; - c = approx[2]; - - - if(monArene !=NULL) // ajout de l'offset de l'arène - { - a.x += monArene->x; - a.y += monArene->y; - b.x += monArene->x; - b.y += monArene->y; - c.x += monArene->x; - c.y += monArene->y; - } - - center.x = (a.x + b.x + c.x)/3; - center.y = (a.y + b.y + c.y)/3; - - posTriangle[nbrTriangle].center=center; - - if(euclideanDist(center,b) > euclideanDist(center,a) && euclideanDist(center,b) > euclideanDist(center,c) ) - { - - posTriangle[nbrTriangle].direction=b; - //line(img,center,b,Scalar(0,125,0),2,8,0); - } - else if(euclideanDist(center,a) > euclideanDist(center,c)) - { - posTriangle[nbrTriangle].direction=a; - //line(img,center,a,Scalar(0,125,0),2,8,0); - - } - else - { - posTriangle[nbrTriangle].direction=c; - //line(img,center,c,Scalar(0,125,0),2,8,0); - } - posTriangle[nbrTriangle].angle=calculAngle(&posTriangle[nbrTriangle]); - - nbrTriangle++; - - } - } - return nbrTriangle; -} - -void draw_position(Image *imgInput, Image *imgOutput, Position *positionRobot) // img E/S pos : E -{ - if(imgInput!=imgOutput) - { - *imgOutput=imgInput->clone(); - } - line(*imgOutput,positionRobot->center,positionRobot->direction,Scalar(0,125,0),2,8,0); -} - -float calculAngle(Position * positionRobot) // position en entree -{ - float a = positionRobot->direction.x - positionRobot->center.x; - float b = positionRobot->direction.y - positionRobot->center.y ; - float angle = atan2(b,a); - return angle * 180.f/M_PI; - -} diff --git a/software/raspberry/superviseur-robot/lib/image.h b/software/raspberry/superviseur-robot/lib/image.h deleted file mode 100644 index 418f372..0000000 --- a/software/raspberry/superviseur-robot/lib/image.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -#ifndef _IMAGE_H_ -#define _IMAGE_H_ - -#ifndef __STUB__ -#ifndef __FOR_PC__ -#include -#else -#include -#endif /* __FOR_PC__ */ -#else -#include -#endif -#include "opencv2/imgproc/imgproc.hpp" -#include -#include - -#define WIDTH 480 //1280 1024 640 480 -#define HEIGHT 360 // 960 768 480 360 - -using namespace std; -using namespace cv; -#ifndef __STUB__ -#ifndef __FOR_PC__ -using namespace raspicam; -#endif /* __FOR_PC__ */ -#endif - -typedef Mat Image; -#ifndef __STUB__ -#ifndef __FOR_PC__ -typedef RaspiCam_Cv Camera; -#else -typedef int Camera; -#endif /* __FOR_PC__ */ -#else -typedef int Camera; -#endif - -typedef Rect Arene; -typedef vector Jpg; - -struct Position { - Point center; - Point direction; - float angle; -}; - -/** - * \brief Ouvre une camera. - * \details Met à jour le descripteur de fichier passé en paramètre pour correspondre à la camera ouverte - * - * \param camera Pointeur d'un file descriptor d'une camera ouverte - * \return Retourne 0 si la camera a été ouverte correctement et -1 si une erreur survient. - */ -int open_camera(Camera *camera); - -/** - * \brief Ferme la camera passé en paramètre - * - * \param camera Pointeur sur la camera à fermer - */ -void close_camera(Camera *camera); - -/** - * \brief Capture une image avec la camera passée en entrée. En cas de test sans camera, la fonction charge une image - * \details La camera doit préalablement être ouverte via \a openCamera(...) - * - * \param camera Pointeur sur la camera passée en entrée. - * \param monImage Pointeur sur une image capturée. - * \param fichier Chemin du fichier d'image - * \return Retourne -1 si une erreur survient. - */ -void get_image(Camera *camera, Image * monImage, const char *fichier = NULL); - -/** - * \brief Détecte une arène dans une image fournis en paramètre. - * - * \param monImage Pointeur sur l'image d'entrée - * \param rectangle Pointeur sur les coordonnées du rectangles trouvé. - * \return Retourne -1 si aucune arène n'est détectée. Sinon retourne 0 - */ -int detect_arena(Image *monImage, Arene *rectangle); - -/** - * \brief Dessine le plus petit rectangle contenant l'arène - - * \param imgInput Pointeur sur l'image d'entrée. - * \param imgOutput Pointeur sur l'image de sortie (image d'entrée + arène marquée) - * \param monArene Pointeur de type Arène contenant les information à dessiner - */ -void draw_arena(Image *imgInput, Image *imgOutput, Arene *monArene); - -/** - * \brief Détecte la position d'un robot. - * \details Détecte la position de triangles blanc sur une image /a imgInput passé en paramètre d'entrer. - * - * \param imgInput Pointeur sur l'image sur laquelle chercher la position du des robots. - * \param posTriangle Pointeur sur un tableau de position ou seront stocké les positions des triangles détectés. - * \param monArene Pointeur de type Arène si nécessaire d'affiner la recherche (optionnel) - * \return Le nombre de triangles détectés. - */ -int detect_position(Image *imgInput, Position *posTriangle, Arene * monArene = NULL); - -/** - * \brief Dessine sur une image en entrée la position d'un robot et sa direction. - * \details Sauvegarde l'image des coordonnées passées par positionRobot superposée à l'image d'entrée sur imgOutput. - * - * \param imgInput Pointeur sur l'image d'entrée - * \param imgOutput Pointeur sur l'image de sortie ( image d'entrée + dessin de la position) - * \param positionRobot Pointeur sur la structure position d'un robot. - */ -void draw_position(Image *imgInput, Image *imgOutput, Position *positionRobot); - -/** - * \brief Détecte la position d'un robot. - * \details Détecte la position de triangles blanc sur une image /a imgInput passé en paramètre d'entrer. - * - * \param imgInput Pointeur sur l'image à sauvegarder en mémoire sous format jpg. - * \param imageCompress Pointeur sur une image .jpg. - */ -void compress_image(Image *imgInput, Jpg *imageCompress); - -#endif // _IMAGE_H_ diff --git a/software/raspberry/superviseur-robot/lib/img.cpp b/software/raspberry/superviseur-robot/lib/img.cpp index 1d74b98..e7bfea3 100644 --- a/software/raspberry/superviseur-robot/lib/img.cpp +++ b/software/raspberry/superviseur-robot/lib/img.cpp @@ -17,23 +17,47 @@ #include "img.h" +/** + * Tell if arena is empty (not found) or not + * @return true if no arena found, false otherwise + */ bool Arena::IsEmpty() { if ((this->arena.height == 0) || (this->arena.width == 0)) return true; else return false; } +/** + * Create new Img object based on image data + * + * @param imgMatrice Image data to be stored (raw data) + */ Img::Img(ImageMat imgMatrice) { this->img = imgMatrice.clone(); } +/** + * Convert object to a string representation + * + * @return String containing information on contained image (size and number of channel) + */ string Img::ToString() { return "Image size: " + to_string(this->img.cols) + "x" + to_string(this->img.rows) + " (dim=" + to_string(this->img.dims) + ")"; } +/** + * Create a copy of current object + * + * @return New Img object, copy of current + */ Img* Img::Copy() { return new Img(this->img); } +/** + * Function for computing angle + * @param robots Position of robot + * @return Angle + */ float Img::CalculAngle(Position robot) { float a = robot.direction.x - robot.center.x; float b = robot.direction.y - robot.center.y; @@ -41,6 +65,12 @@ float Img::CalculAngle(Position robot) { return angle * 180.f / M_PI; } +/** + * Function for computing angle + * @param pt1 ??? + * @param pt2 ??? + * @return Angle + */ float Img::CalculAngle2(cv::Point2f pt1, cv::Point2f pt2) { float a = pt1.x - pt2.x; float b = pt1.y - pt2.y; @@ -50,21 +80,59 @@ float Img::CalculAngle2(cv::Point2f pt1, cv::Point2f pt2) { #ifdef __WITH_ARUCO__ +/** + * Find center point of given aruco + * @param aruco Aruco coordinates + * @return Center point coordinate + */ cv::Point2f Img::FindArucoCenter(std::vector aruco) { return ((aruco[0] + aruco[2]) / 2); } +/** + * Find direction of given aruco + * @param aruco Aruco coordinates + * @return Orientation of aruco + */ cv::Point2f Img::FindArucoDirection(std::vector aruco) { return ((aruco[0] + aruco[1]) / 2); } +#endif // __WITH_ARUCO__ -std::list Img::SearchAruco(Arena arena) { +/** + * Used for computing distance + * @param p ??? + * @param q ??? + * @return Distance + */ +float Img::EuclideanDistance(cv::Point2f p, cv::Point2f q) { + cv::Point diff = p - q; + return cv::sqrt(diff.x * diff.x + diff.y * diff.y); +} + +/** + * Compress current image to JPEG + * @return Image compressed as JPEG + */ +Jpg Img::ToJpg() { + Jpg imgJpg; + cv::imencode(".jpg", this->img, imgJpg); + return imgJpg; +} + +/** + * Search available robots in an image + * @param arena Arena position for cropping image + * @return list of position, empty if no robot found + */ +std::list Img::SearchRobot(Arena arena) { +#ifdef __WITH_ARUCO__ ImageMat imgTraitment; std::list positionList; cv::Point2f areneCoor; std::vector ids; std::vector > corners; - + if (arena.IsEmpty()) imgTraitment = this->img.clone(); else { @@ -72,7 +140,7 @@ std::list Img::SearchAruco(Arena arena) { areneCoor.x = arena.arena.x; areneCoor.y = arena.arena.y; } - + cv::aruco::detectMarkers(imgTraitment, dictionary, corners, ids); if (ids.size() > 0) { for (int i = 0; i < ids.size(); i++) { @@ -89,22 +157,7 @@ std::list Img::SearchAruco(Arena arena) { } } return positionList; -} -#endif // __WITH_ARUCO__ - -float Img::EuclideanDistance(cv::Point2f p, cv::Point2f q) { - cv::Point diff = p - q; - return cv::sqrt(diff.x * diff.x + diff.y * diff.y); -} - -Jpg Img::ToJpg() { - Jpg imgJpg; - cv::imencode(".jpg", this->img, imgJpg); - return imgJpg; -} - -std::list Img::SearchRobot(Arena arena) { - +#else std::list robotsFind; std::vector > contours; std::vector approx; @@ -168,8 +221,14 @@ std::list Img::SearchRobot(Arena arena) { } return robotsFind; + +#endif // __WITH_ARUCO__ } +/** + * Search arena outline in current image + * @return Arena object with coordinate of outline, empty if no arena found + */ Arena Img::SearchArena() { std::vector > contours; std::vector approx; @@ -189,26 +248,44 @@ Arena Img::SearchArena() { return rectangle; } } + return Arena(); } -int Img::DrawRobot(Position robot) { +/** + * Draw an oriented arrow at robot position + * @param robot Position of robot + */ +void Img::DrawRobot(Position robot) { cv::arrowedLine(this->img, (cv::Point2f)robot.center, (cv::Point2f)robot.direction, cv::Scalar(0, 0, 255), 3, 8, 0); - return 0; } +/** + * Draw an oriented arrow for each position provided + * @param robots List of robot positions + * @return Number of position drawn + */ int Img::DrawAllRobots(std::list robots) { for (Position robot : robots) { cv::arrowedLine(this->img, (cv::Point2f)robot.center, (cv::Point2f)robot.direction, cv::Scalar(0, 0, 255), 3, 8, 0); } + return robots.size(); } -int Img::DrawArena(Arena arenaToDraw) { +/** + * Draw arena outline + * @param arenaToDraw Arena position + */ +void Img::DrawArena(Arena arenaToDraw) { cv::rectangle(this->img, arenaToDraw.arena.tl(), arenaToDraw.arena.br(), cv::Scalar(0, 0, 125), 2, 8, 0); - return 0; } +/** + * Crop image around detected arena + * @param arena Coordinate of arena + * @return Reduced image, focused on arena + */ ImageMat Img::CropArena(Arena arena) { return this->img(arena.arena); } diff --git a/software/raspberry/superviseur-robot/lib/img.h b/software/raspberry/superviseur-robot/lib/img.h index b928448..d1b873b 100644 --- a/software/raspberry/superviseur-robot/lib/img.h +++ b/software/raspberry/superviseur-robot/lib/img.h @@ -29,64 +29,181 @@ #ifdef __WITH_ARUCO__ #include #include -//#include #include - #endif // __WITH_ARUCO__ #define ARENA_NOT_DETECTED -1 using namespace std; +/** + * Redefinition of cv::Mat type + */ typedef cv::Mat ImageMat; +/** + * Declaration of Jpg type + */ typedef vector Jpg; +/** + * Position type used for store robot coordinates + * + * @brief Position type used for store robot coordinates + */ typedef struct { - cv::Point2f center; + cv::Point2f center; cv::Point2f direction; float angle; int robotId; } Position; +/** + * Class arena, used for holding outline of arena on image and cropping image to only usefull area + * + * @brief Class arena, used for holding outline of arena on image and cropping image to only usefull area + */ class Arena { public: + /** + * Constructor of Arena object + */ Arena() {} + /** + * Coordinate of arena, empty if no arena found + */ cv::Rect arena; + + /** + * Tell if arena is empty (not found) or not + * @return true if no arena found, false otherwise + */ bool IsEmpty(); }; +/** + * Class for image storage and treatment + * + * @brief Class for image storage and treatment + */ class Img { public: + /** + * Image data + */ ImageMat img; + /** + * Create new Img object based on image data + * + * @param imgMatrice Image data to be stored (raw data) + */ Img(ImageMat imgMatrice); + /** + * Convert object to a string representation + * + * @return String containing information on contained image (size and number of channel) + */ string ToString(); + + /** + * Create a copy of current object + * + * @return New Img object, copy of current + */ Img* Copy(); + /** + * Compress current image to JPEG + * @return Image compressed as JPEG + */ Jpg ToJpg(); + + /** + * Search arena outline in current image + * @return Arena object with coordinate of outline, empty if no arena found + */ Arena SearchArena(); - - int DrawRobot(Position robot); + + /** + * Draw an oriented arrow at robot position + * @param robot Position of robot + */ + void DrawRobot(Position robot); + + /** + * Draw an oriented arrow for each position provided + * @param robots List of robot positions + * @return Number of position drawn + */ int DrawAllRobots(std::list robots); - int DrawArena(Arena arenaToDraw); + + /** + * Draw arena outline + * @param arenaToDraw Arena position + */ + void DrawArena(Arena arenaToDraw); + + /** + * Search available robots in an image + * @param arena Arena position for cropping image + * @return list of position, empty if no robot found + */ std::list SearchRobot(Arena arena); #ifdef __WITH_ARUCO__ - list SearchAruco(Arena arena); + /** + * Dictionary to be used for aruco recognition + */ cv::Ptr dictionary; #endif // __WITH_ARUCO__ private: #ifdef __WITH_ARUCO__ + /** + * Find center point of given aruco + * @param aruco Aruco coordinates + * @return Center point coordinate + */ cv::Point2f FindArucoCenter(std::vector aruco); + + /** + * Find direction of given aruco + * @param aruco Aruco coordinates + * @return Orientation of aruco + */ cv::Point2f FindArucoDirection(std::vector aruco); #endif // __WITH_ARUCO__ + /** + * Function for computing angle + * @param robots Position of robot + * @return Angle + */ float CalculAngle(Position robots); + + /** + * Function for computing angle + * @param pt1 ??? + * @param pt2 ??? + * @return Angle + */ float CalculAngle2(cv::Point2f pt1, cv::Point2f pt2); + + /** + * Used for computing distance + * @param p ??? + * @param q ??? + * @return Distance + */ float EuclideanDistance(cv::Point2f p, cv::Point2f q); + + /** + * Crop image around detected arena + * @param arena Coordinate of arena + * @return Reduced image, focused on arena + */ ImageMat CropArena(Arena arena); }; diff --git a/software/raspberry/superviseur-robot/lib/message.cpp b/software/raspberry/superviseur-robot/lib/message.cpp deleted file mode 100644 index d9e1eb2..0000000 --- a/software/raspberry/superviseur-robot/lib/message.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file message.cpp - * \author PE.Hladik - * \version 1.0 - * \date 06/06/2017 - * \brief Functions for sending message to monitor. - */ - -#include "message.h" - -void set_msgToMon_header(MessageToMon *msg, char *header) { - memcpy(msg->header, header, sizeof (header)); -} - -void set_msgToMon_data(MessageToMon *msg, void * data) { - if (msg->data != NULL) { - free(msg->data); - } - msg->data = malloc(sizeof (data)); - memcpy(msg->data, data, sizeof (data)); -} - -void free_msgToMon_data(MessageToMon *msg) { - if (msg->data != NULL) { - free(msg->data); - } -} - -void print_msgToMon(MessageToMon *msg) { - printf("header: %s\n", msg->header); - printf("data: %s\n", (char*)msg->data); -} diff --git a/software/raspberry/superviseur-robot/lib/message.h b/software/raspberry/superviseur-robot/lib/message.h deleted file mode 100644 index d49a0d9..0000000 --- a/software/raspberry/superviseur-robot/lib/message.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file message.h - * \author PE.Hladik - * \version 1.0 - * \date 06/06/2017 - * \brief Functions for sending message to monitor. - */ - -#ifndef MESSAGE_H -#define MESSAGE_H - -#include -#include -#include -#include - -typedef struct { - char header[4]; - void *data = NULL; -} MessageToMon; - -/** - * \brief Set header part of monitor message. - * - */ -void set_msgToMon_header(MessageToMon *msg, char *header); - -/** - * \brief Set data part of monitor message. - */ -void set_msgToMon_data(MessageToMon *msg, void *data); - -/** - * \brief Dealocate moemory pointed by data part of message. - */ -void free_msgToMon_data(MessageToMon *msg); - -/** - * \brief Print message, header and data. - */ -void print_msgToMon(MessageToMon *msg); - -#endif /* MESSAGE_H */ - diff --git a/software/raspberry/superviseur-robot/lib/messages.h b/software/raspberry/superviseur-robot/lib/messages.h index 3d5ba9c..d64919a 100644 --- a/software/raspberry/superviseur-robot/lib/messages.h +++ b/software/raspberry/superviseur-robot/lib/messages.h @@ -383,7 +383,7 @@ public: /** * Set message ID * @param id Message ID - * @throw std::runtime_error if message ID is incompatible withimage message + * @throw std::runtime_error if message ID is incompatible with image message */ void SetID(MessageID id); @@ -436,12 +436,12 @@ protected: class MessagePosition : public Message { public: /** - * Create a new, empty image message + * Create a new, empty position message */ MessagePosition(); /** - * Create a new image message, with given ID and boolean value + * Create a new position message, with given ID and position * @param id Message ID * @param pos Position * @throw std::runtime_error if message ID is incompatible with image message @@ -451,21 +451,21 @@ public: /** * Set message ID * @param id Message ID - * @throw std::runtime_error if message ID is incompatible withimage message + * @throw std::runtime_error if message ID is incompatible with position message */ void SetID(MessageID id); /** - * Get message image - * @return Pointer to image + * Get position + * @return Position */ Position GetPosition() { return pos; } /** - * Set message image - * @param image Pointer to image object + * Set position + * @param pos Reference to position */ void SetPosition(Position& pos); @@ -483,7 +483,7 @@ public: protected: /** - * Message position + * Position */ Position pos; @@ -498,42 +498,42 @@ protected: /** * Message class for holding battery level, based on Message class * - * @brief Position message class + * @brief Battery message class * */ class MessageBattery : public Message { public: /** - * Create a new, empty image message + * Create a new, empty battery message */ MessageBattery(); /** - * Create a new image message, with given ID and boolean value + * Create a new battery message, with given ID and battery level * @param id Message ID - * @param image Pointer to image - * @throw std::runtime_error if message ID is incompatible with image message + * @param level Battery level + * @throw std::runtime_error if message ID is incompatible with battery message */ MessageBattery(MessageID id, BatteryLevel level); /** * Set message ID * @param id Message ID - * @throw std::runtime_error if message ID is incompatible withimage message + * @throw std::runtime_error if message ID is incompatible with battery message */ void SetID(MessageID id); /** * Get message image - * @return Pointer to image + * @return Battery level */ BatteryLevel GetLevel() { return level; } /** - * Set message image - * @param image Pointer to image object + * Set battery level + * @param level Battery level */ void SetLevel(BatteryLevel level); @@ -551,7 +551,7 @@ public: protected: /** - * Message position + * Battery level */ BatteryLevel level; diff --git a/software/raspberry/superviseur-robot/lib/monitor.cpp b/software/raspberry/superviseur-robot/lib/monitor.cpp deleted file mode 100644 index b0272cb..0000000 --- a/software/raspberry/superviseur-robot/lib/monitor.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file monitor.cpp - * \author L.senaneuch - * \version 1.0 - * \date 06/06/2017 - * \brief Library for sending message to monitor or receiving message - */ - -#include "monitor.h" -#include "server.h" - -using namespace std; - -SOCKADDR_IN ssin; -SOCKET sock; -socklen_t recsize = sizeof (ssin); - -string serverReceive(int size); -int sendMessage(const char *data, int dataLength); -int receive(char *data); - -int send_message_to_monitor(const char* typeMessage, const void * data) { - if ((string) typeMessage == HEADER_STM_IMAGE) { - Jpg * imgC = (Jpg*) data; - sendMessage("IMG", 3); - sendMessage((const char*) imgC->data(), imgC->size()); - sendMessage("TRAME", 5); - return 0; - } else if ((string) typeMessage == HEADER_STM_POS) { - char buffer[400]; - Position * maPosition = (Position*) data; - sprintf(buffer, "POScenter: %3d;%3d | %.1fTRAME", maPosition->center.x, maPosition->center.y, maPosition->angle); - sendMessage(buffer, strlen(buffer)); - return 0; - } else if ((string) typeMessage == HEADER_STM_MES) { - char buffer[50]; - sprintf(buffer, "MSG%sTRAME", (const char*) data); - sendMessage(buffer, strlen(buffer)); - return 0; - } else if ((string) typeMessage == HEADER_STM_ACK) { - char buffer[50]; - sprintf(buffer, "ACK%sTRAME", (const char*) data); - sendMessage(buffer, strlen(buffer)); - return 0; - } else if ((string) typeMessage == HEADER_STM_BAT) { - char buffer[50]; - sprintf(buffer, "BAT%sTRAME", (const char*) data); - sendMessage(buffer, strlen(buffer)); - return 0; - } else if ((string) typeMessage == HEADER_STM_NO_ACK) { - char buffer[50]; - sprintf(buffer, "NAK%sTRAME", (const char*) data); - sendMessage(buffer, strlen(buffer)); - return 0; - } else if ((string) typeMessage == HEADER_STM_LOST_DMB) { - char buffer[50]; - sprintf(buffer, "LCD%sTRAME", (const char*) data); - sendMessage(buffer, strlen(buffer)); - return 0; - } else { - return -1; - } -} - -int receive_message_from_monitor(char *typeMessage, char *data) { - char buffer[20]; - int tBuffer = receive(buffer); - sscanf(buffer, "%3s:%s", typeMessage, data); - return tBuffer; -} - -int receive(char *data) { - int result; - result = receiveDataFromServer(data, 20); - //cout <<"Data : " << data << endl; - return result; -} - -int sendMessage(const char *data, int dataLength) { - if (sendDataToServer((char*) data, dataLength) != dataLength) { - perror("Send failed : "); - return false; - } - - return true; -} diff --git a/software/raspberry/superviseur-robot/lib/monitor.h b/software/raspberry/superviseur-robot/lib/monitor.h deleted file mode 100644 index e7f3eb2..0000000 --- a/software/raspberry/superviseur-robot/lib/monitor.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file monitor.h - * \author L.senaneuch - * \version 1.0 - * \date 06/06/2017 - * \brief Library for sending message to monitor or receiving message - */ - -#ifndef _MONITOR_H_ -#define _MONITOR_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "image.h" -#include "definitions.h" - -#define HEADER_STM_IMAGE "IMG" // Envoi d'une image -#define HEADER_STM_BAT "BAT" // Envoi de l'état de la batterie -#define HEADER_STM_POS "POS" // Envoi de la position -#define HEADER_STM_NO_ACK "NAK" // Acquittement d'un échec -#define HEADER_STM_ACK "ACK" // Acquittement d'un succès -#define HEADER_STM_MES "MSG" // Message textuel -#define HEADER_STM_LOST_DMB "LCD" // Perte de la communication avec le robot - -#define HEADER_MTS_MSG "MSG" // Message directe pour Console Dumber -#define HEADER_MTS_DMB_ORDER "DMB" // Message d'ordre pour le robot -#define HEADER_MTS_COM_DMB "COM" // Message de gestion de la communication avec le robot -#define HEADER_MTS_CAMERA "CAM" // Message de gestion de la camera -#define HEADER_MTS_STOP "STO" // Message d'arrêt du system - -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 - -#define DEFAULT_PORT 8080 -#define DEFAULT_PARITY 0 - -#define DETECT_ARENA (1) -#define CHECK_ARENA (2) -#define NO_ARENA (3) - -#define DEFAULT_NODEJS_PATH "/usr/bin/nodejs" -#define DEFAULT_INTERFACE_FILE "./interface.js" - -#define closesocket(param) close(param) - -typedef int SOCKET; -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr SOCKADDR; - -typedef struct { - char header[4]; - char data[100]; -} MessageFromMon; - -/** - * \brief Envoi d'un message vers l'interface graphique - * \param typeMessage Type du message envoyé. Les valeurs possibles sont - * IMG pour une image, MES pour un message à afficher dans la console, POS pour - * la position du robot, BAT pour une valeur de la batterie et ACK pour valider - * un message de l'interface. - * \param data données associées au message. Le type de la donnée doit - * correspondre au message : Image pour IMG, char * MES, Position pour POS, - * char * pour BAT et rien pour ACK. Attention, il n'y a aucune vérification - * a posterio. - * \return Retourne 0 si l'envoie a bien été réalisé et -1 en cas de problème. - */ -int send_message_to_monitor(const char* typeMessage, const void * data = NULL); - -/** - * \brief Réception d'un message. La fonction est bloquante et retourne par - * référence le type de message reçu (DMB pour un ordre au robot, ARN pour la - * détection des arènes et POS pour un calcul de position) ainsi que les données - * associées. - * \param typeMessage Type du message reçu : DMB pour un ordre au robot, - * ARN pour la demande de détection de l'arène, POS pour un calcul de position - * et MSG pour un message de l'interface - * \param data données associées au message reçu. - * \return Retourne 0 la taille du message reçu ou une valeur négative si la - * connexion est perdue. - */ -int receive_message_from_monitor(char *typeMessage, char *data); - - -#endif // _MONITOR_H_ diff --git a/software/raspberry/superviseur-robot/lib/robot.cpp b/software/raspberry/superviseur-robot/lib/robot.cpp deleted file mode 100644 index 33ebb84..0000000 --- a/software/raspberry/superviseur-robot/lib/robot.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file robot.h - * \author L.Senaneuch - * \version 1.0 - * \date 06/06/2017 - * \brief Fonctions for communicating with robot. - */ - -#include "robot.h" - -int fd; - -int getChar(char * c); -int readSerial(char * msg); -char checkSumGO(char * msg); -int receiveMsg(void); -int sendCmd(char cmd, const char * arg); - -int open_communication_robot(const char * path) -{ -#ifndef __STUB__ - struct termios options; - fd = open(path, O_RDWR | O_NOCTTY | O_NDELAY); - if(fd !=-1) - { - fcntl(fd, F_SETFL, 0); - tcgetattr(fd, &options); - options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); - cfsetospeed (&options, B9600); - cfsetispeed (&options, B9600); - options.c_cc[VMIN]=0; - options.c_cc[VTIME]=0; - tcsetattr(fd, TCSANOW, &options); - return 0; - } - else - { - perror("can't openSerial"); - return -1; - } -#else - return 0; -#endif -} - - -int close_communication_robot(void) -{ -#ifndef __STUB__ - return close(fd); -#else - return 0; -#endif -} - - -int send_command_to_robot(char cmd, const char * arg) -{ -#ifndef __STUB__ - sendCmd(cmd,arg); - // TODO : check return from sendCmd - return receiveMsg(); -#else - int reponse; - switch(cmd) - { - case DMB_PING: - reponse = 0; - break; - case DMB_IDLE: - reponse = 0; - break; - case DMB_START_WITH_WD: - reponse = 0; - break; - case DMB_RELOAD_WD: - reponse = 0; - break; - case DMB_GET_VBAT: - reponse = 2; - break; - case DMB_IS_BUSY: - reponse = 1; - break; - case DMB_START_WITHOUT_WD: - reponse = 0; - break; - case DMB_MOVE: - reponse = 0; - break; - case DMB_TURN: - reponse = 0; - break; - case DMB_GO_FORWARD: - reponse = 0; - break; - case DMB_GO_BACK: - reponse = 0; - break; - case DMB_GO_LEFT: - reponse = 0; - break; - case DMB_GO_RIGHT: - reponse = 0; - break; - case DMB_STOP_MOVE: - reponse = 0; - break; - default: - reponse = 0; - break; - } - return reponse; -#endif -} - -/****************************/ -/* PRIVATE */ -/****************************/ - -int sendCmd(char cmd, const char * arg) -{ - char cmdWithArg[20]={}; - cmdWithArg[0]=cmd; - switch(cmd) - { - case DMB_GO_FORWARD: strcpy(cmdWithArg,"M=+64000"); - break; - case DMB_GO_BACK: strcpy(cmdWithArg,"M=-64000"); - break; - case DMB_GO_LEFT: strcpy(cmdWithArg,"T=+64000"); - break; - case DMB_GO_RIGHT: strcpy(cmdWithArg,"T=-64000"); - break; - case DMB_STOP_MOVE: strcpy(cmdWithArg,"M=0"); - break; - case DMB_MOVE: strcat(cmdWithArg,"="); - strcat(cmdWithArg,arg); - break; - case DMB_TURN: strcat(cmdWithArg,"="); - strcat(cmdWithArg,arg); - break; - } - int sizeCmd = strlen(cmdWithArg); - cmdWithArg[sizeCmd] = checkSumGO(cmdWithArg); - cmdWithArg[sizeCmd+1] = '\r'; - cmdWithArg[sizeCmd+2] = '\0'; - return write(fd,cmdWithArg,strlen(cmdWithArg)); -} - -int receiveMsg(void) -{ - char msg[20]; - int b; - if((b = readSerial(msg))!=ROBOT_TIMED_OUT) - { - int taille = strlen(msg); - char checksum = msg[taille-2]; - msg[taille-1] = 0; - msg[taille-2] = 0; - if(checksum!=checkSumGO(msg)) - { - return ROBOT_CHECKSUM; - } - else - { - switch(msg[0]) - { - case 'O' : return 0; - case 'E' : return ROBOT_ERROR; - case 'C' : return ROBOT_UKNOWN_CMD; - default : return atoi(&msg[0]); - } - } - } - else - { - return ROBOT_TIMED_OUT; - } -} - -int getChar(char * c) -{ - int n =0; - int delay =0; - while((n=read(fd,c,1)) <=0) - { - usleep(5000); - delay++; - if(delay > 10) - { - return ROBOT_TIMED_OUT; - } - - } - return n; -} - -int readSerial(char * msg) -{ - char car=0; - int i=0; - for(int j = 0 ; j < 20 ; j++) - msg[j]=0; - - while(car !='\r' && car!='\n') { - if(i>=20) - return -5; - - if(getChar(&car)==ROBOT_TIMED_OUT) { - return ROBOT_TIMED_OUT; - } - - msg[i] = car; - i++; - } - return i; -} - -char checkSumGO(char * msg) -{ - char resultat = 0; - int i = 0; - int taille = strlen(msg); - for(i=0;i. - */ - -/** - * \file robot.h - * \author L.Senaneuch - * \version 1.0 - * \date 06/06/2017 - * \brief Fonctions for communicating with robot. - */ - -#ifndef _ROBOT_H_ -#define _ROBOT_H_ - -#include -#include -#include -#include -#include -#include -#include "definitions.h" - -#ifdef __FOR_PC__ -#define serialPort "/dev/ttyUSB0" -#else -#define serialPort "/dev/ttyS0" -#endif /* __FOR_PC__ */ - -typedef struct - { - char header[4]; - char data[20]; - } MessageToRobot; - - /** - * \brief Ouvre la communication avec le robot. - * \details Ouvre le serial port passé en paramétre. Par defaut cette fonction ouvre le port ttySO connecté au module xbee. - * - * \param path Chaine de caractère contenant le path du port serie à ouvrir. - * \return Return -1 si l'ouverture c'est mal passé et 0 si le port est ouvert. - */ -int open_communication_robot(const char * path=serialPort); - - /** - * \brief Ferme la communication avec le robot. - * \details Ferme le descripteur de fichier du port serie contrôlant le robot. - * - * \return Retourne -1 en cas d'erreur ou 0 en cas de fermeture effectué - */ -int close_communication_robot(void); - - /** - * \brief Envoi une commande au robot et attends sa réponse. - * \details Envoi une commande au robot en ajoutant le checksum et lis la réponse du robot en verifiant le checksum. - Le premier paramétre \a cmd correspond au type de commande ex : PING, SETMOVE ... - Le second paramétre \a *arg correspond aux arguments à la commande ex : SETMOVE, "100" - La fonction retourne un code confirmation transmise par le robot (ROBOT_CHEKSUM, ROBOT_ERROR, ROBOT_TIMED_OUT, ROBOT_OK, ROBOT_UKNOW_CMD) - * - * \param cmd Entête de la commande - * \param arg Argument de la commande - * \return Retourne un code confirmation. - */ -int send_command_to_robot(char cmd, const char * arg=NULL); - -#endif //_ROBOT_H_ diff --git a/software/raspberry/superviseur-robot/lib/server.cpp b/software/raspberry/superviseur-robot/lib/server.cpp deleted file mode 100644 index 5b795c2..0000000 --- a/software/raspberry/superviseur-robot/lib/server.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file server.cpp - * \author PE.Hladik - * \version 1.0 - * \date 06/06/2017 - * \brief Library for opening a TCP server, receiving data and sending message to monitor - */ - -#include "server.h" -#include -#include -#include - -#include -#include -#include - -#include "image.h" -#include "monitor.h" - -#define NB_CONNECTION_MAX 1 - -int socketFD = -1; -int clientID = -1; - -char* imgMsg = NULL; - -int openServer(int port) { - struct sockaddr_in server; - - socketFD = socket(AF_INET, SOCK_STREAM, 0); - if (socketFD < 0) { - perror("Can not create socket"); - exit(-1); - } - - server.sin_addr.s_addr = INADDR_ANY; - server.sin_family = AF_INET; - server.sin_port = htons(port); - - if (bind(socketFD, (struct sockaddr *) &server, sizeof (server)) < 0) { - perror("Can not bind socket"); - exit(-1); - } - - listen(socketFD, NB_CONNECTION_MAX); - - return socketFD; -} - -int closeServer() { - close(socketFD); - - socketFD = -1; - - return 0; -} - -int acceptClient() { - struct sockaddr_in client; - int c = sizeof (struct sockaddr_in); - - clientID = accept(socketFD, (struct sockaddr *) &client, (socklen_t*) & c); - - if (clientID < 0) { - perror("Accept failed in acceptClient"); - exit(-1); - } - - return clientID; -} - -int sendDataToServer(char *data, int length) { - return sendDataToServerForClient(clientID, data, length); -} - -int sendDataToServerForClient(int client, char *data, int length) { - if (client >= 0) - return write(client, (void*)data, length); - else return 0; -} - -int receiveDataFromServer(char *data, int size) { - return receiveDataFromServerFromClient(clientID, data, size); -} - -int receiveDataFromServerFromClient(int client, char *data, int size) { - char length = 0; - - if (client > 0) { - if ((length = recv(client, (void*)data, size, 0)) > 0) { - data[length] = 0; - } - } - - return length; -} - -int sendImage(Jpg *image) -{ - int status = 0; - int lengthSend; - - if (imgMsg != NULL) free((void*) imgMsg); - imgMsg = (char*) malloc(image->size()+ 4); - imgMsg[0] = HEADER_STM_IMAGE[0]; - imgMsg[1] = HEADER_STM_IMAGE[1]; - imgMsg[2] = HEADER_STM_IMAGE[2]; - imgMsg[3] = ':'; - - memcpy((void*) &imgMsg[4], (const void *) reinterpret_cast (image->data()), image->size()); - - lengthSend=sendDataToServer(imgMsg, image->size() + 4); - - return status; -} - - - diff --git a/software/raspberry/superviseur-robot/lib/server.h b/software/raspberry/superviseur-robot/lib/server.h deleted file mode 100644 index aadda1c..0000000 --- a/software/raspberry/superviseur-robot/lib/server.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2018 dimercur - * - * This program 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. - * - * This program 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 this program. If not, see . - */ - -/** - * \file server.h - * \author PE.Hladik - * \version 1.0 - * \date 06/06/2017 - * \brief Library for opening a TCP server, receiving data and sending message to monitor - */ - -#ifndef _SERVER_H_ -#define _SERVER_H_ - -#include "image.h" -#define DEFAULT_SERVER_PORT 2323 - -/** - * \brief Open server port, connect and listen to given port. - * - * \param port A valid port number (1024 - 65535) - * \return -1 if opening failed or the socket number - */ -int openServer (int port); - -/** - * \brief Close server - * - * \return -1 if closing failed , 0 otherwise - */ -int closeServer(); - -/** - * \brief Wait for a client to connect - * - * \return Return client Id or -1 if it failed - */ -int acceptClient(); - -/** - * \brief Send given data to monitor - * \details Send given data to monitor using default client ID - * - * \param data A valid pointer to a buffer - * \param length Amount of data to send - * \return Return amount of data really written. 0 if communication is broken - */ -int sendDataToServer(char *data, int length); - -/** - * \brief Send given data to monitor, using specific client ID - * \details Send given data to monitor using given client ID. - * - * \param client Client Id to send data to - * \param data A valid pointer to a buffer - * \param length Amount of data to send - * \return Return amount of data really written. 0 if communication is broken - */ -int sendDataToServerForClient(int client, char *data, int length); - -/** - * \brief Read data from monitor. - * \details Read, at most, size data from monitor. Data must be a valid pointer to a buffer large enough. - * - * \param data A valid pointer to a buffer - * \param size Amount of data to read - * \return Return amount of data really received. 0 if communication is broken - */ -int receiveDataFromServer(char *data, int size); - -/** - * \brief Read data from monitor, using specific client ID. - * \details Read, at most, size data from monitor. Data must be a valid pointer to a buffer large enough. - * - * \param client Client Id to receive from - * \param data A valid pointer to a buffer - * \param size Amount of data to read - * \return Return amount of data really received. 0 if communication is broken - */ -int receiveDataFromServerFromClient(int client, char *data, int size); - -/** - * \brief Send image to monitor using default client ID - * \details Convert image to raw data, and add correct header before sending to monitor - * - * \param image An image object after compression - * \return Return amount of data really received. 0 if communication is broken - */ -int sendImage(Jpg *image); -#endif /* _SERVER_H_ */ - diff --git a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug.mk b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug.mk index 140beb5..a1fda15 100644 --- a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug.mk +++ b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug.mk @@ -40,11 +40,7 @@ OBJECTFILES= \ ${OBJECTDIR}/lib/commonitor.o \ ${OBJECTDIR}/lib/comrobot.o \ ${OBJECTDIR}/lib/img.o \ - ${OBJECTDIR}/lib/message.o \ ${OBJECTDIR}/lib/messages.o \ - ${OBJECTDIR}/lib/monitor.o \ - ${OBJECTDIR}/lib/robot.o \ - ${OBJECTDIR}/lib/server.o \ ${OBJECTDIR}/main.o \ ${OBJECTDIR}/tasks.o \ ${OBJECTDIR}/tasks_pthread.o @@ -99,31 +95,11 @@ ${OBJECTDIR}/lib/img.o: lib/img.cpp ${RM} "$@.d" $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp -${OBJECTDIR}/lib/message.o: lib/message.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/message.o lib/message.cpp - ${OBJECTDIR}/lib/messages.o: lib/messages.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp -${OBJECTDIR}/lib/monitor.o: lib/monitor.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/monitor.o lib/monitor.cpp - -${OBJECTDIR}/lib/robot.o: lib/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/robot.o lib/robot.cpp - -${OBJECTDIR}/lib/server.o: lib/server.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/server.o lib/server.cpp - ${OBJECTDIR}/main.o: main.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" diff --git a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread_.mk b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread_.mk index 2f0f533..b6dd25a 100644 --- a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread_.mk +++ b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread_.mk @@ -72,42 +72,42 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/superviseur-robot: ${OBJECTFILES} ${OBJECTDIR}/lib/base64/base64.o: lib/base64/base64.cpp ${MKDIR} -p ${OBJECTDIR}/lib/base64 ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/base64/base64.o lib/base64/base64.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/base64/base64.o lib/base64/base64.cpp ${OBJECTDIR}/lib/camera.o: lib/camera.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/camera.o lib/camera.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/camera.o lib/camera.cpp ${OBJECTDIR}/lib/commonitor.o: lib/commonitor.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/commonitor.o lib/commonitor.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/commonitor.o lib/commonitor.cpp ${OBJECTDIR}/lib/comrobot.o: lib/comrobot.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp ${OBJECTDIR}/lib/img.o: lib/img.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp ${OBJECTDIR}/lib/messages.o: lib/messages.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp ${OBJECTDIR}/main.o: main.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp ${OBJECTDIR}/tasks_pthread.o: tasks_pthread.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tasks_pthread.o tasks_pthread.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__FOR_PC__ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tasks_pthread.o tasks_pthread.cpp # Subprojects .build-subprojects: diff --git a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk index 5497b0d..fbe985f 100644 --- a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk +++ b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk @@ -76,42 +76,42 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/superviseur-robot: ${OBJECTFILES} ${OBJECTDIR}/lib/base64/base64.o: lib/base64/base64.cpp ${MKDIR} -p ${OBJECTDIR}/lib/base64 ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/base64/base64.o lib/base64/base64.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/base64/base64.o lib/base64/base64.cpp ${OBJECTDIR}/lib/camera.o: lib/camera.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/camera.o lib/camera.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/camera.o lib/camera.cpp ${OBJECTDIR}/lib/commonitor.o: lib/commonitor.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/commonitor.o lib/commonitor.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/commonitor.o lib/commonitor.cpp ${OBJECTDIR}/lib/comrobot.o: lib/comrobot.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp ${OBJECTDIR}/lib/img.o: lib/img.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp ${OBJECTDIR}/lib/messages.o: lib/messages.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp ${OBJECTDIR}/main.o: main.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp ${OBJECTDIR}/tasks_pthread.o: tasks_pthread.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_PTHREAD__ -D__WITH_ARUCO__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tasks_pthread.o tasks_pthread.cpp + $(COMPILE.cc) -g -D_WITH_TRACE_ -D__WITH_ARUCO__ -D__WITH_PTHREAD__ -I./ -I./lib -I./lib/base64 `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tasks_pthread.o tasks_pthread.cpp # Subprojects .build-subprojects: diff --git a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk index 99911b5..8e91918 100644 --- a/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk +++ b/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk @@ -39,13 +39,8 @@ OBJECTFILES= \ ${OBJECTDIR}/lib/camera.o \ ${OBJECTDIR}/lib/commonitor.o \ ${OBJECTDIR}/lib/comrobot.o \ - ${OBJECTDIR}/lib/image.o \ ${OBJECTDIR}/lib/img.o \ - ${OBJECTDIR}/lib/message.o \ ${OBJECTDIR}/lib/messages.o \ - ${OBJECTDIR}/lib/monitor.o \ - ${OBJECTDIR}/lib/robot.o \ - ${OBJECTDIR}/lib/server.o \ ${OBJECTDIR}/main.o \ ${OBJECTDIR}/tasks.o \ ${OBJECTDIR}/tasks_pthread.o @@ -95,41 +90,16 @@ ${OBJECTDIR}/lib/comrobot.o: lib/comrobot.cpp ${RM} "$@.d" $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp -${OBJECTDIR}/lib/image.o: lib/image.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/image.o lib/image.cpp - ${OBJECTDIR}/lib/img.o: lib/img.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp -${OBJECTDIR}/lib/message.o: lib/message.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/message.o lib/message.cpp - ${OBJECTDIR}/lib/messages.o: lib/messages.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp -${OBJECTDIR}/lib/monitor.o: lib/monitor.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/monitor.o lib/monitor.cpp - -${OBJECTDIR}/lib/robot.o: lib/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/robot.o lib/robot.cpp - -${OBJECTDIR}/lib/server.o: lib/server.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -g -D_WITH_TRACE_ -I./ -I./lib -I/usr/xenomai/include -I/usr/xenomai/include/mercury `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/server.o lib/server.cpp - ${OBJECTDIR}/main.o: main.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" diff --git a/software/raspberry/superviseur-robot/nbproject/Makefile-Release.mk b/software/raspberry/superviseur-robot/nbproject/Makefile-Release.mk index be01ad6..8303731 100644 --- a/software/raspberry/superviseur-robot/nbproject/Makefile-Release.mk +++ b/software/raspberry/superviseur-robot/nbproject/Makefile-Release.mk @@ -39,13 +39,8 @@ OBJECTFILES= \ ${OBJECTDIR}/lib/camera.o \ ${OBJECTDIR}/lib/commonitor.o \ ${OBJECTDIR}/lib/comrobot.o \ - ${OBJECTDIR}/lib/image.o \ ${OBJECTDIR}/lib/img.o \ - ${OBJECTDIR}/lib/message.o \ ${OBJECTDIR}/lib/messages.o \ - ${OBJECTDIR}/lib/monitor.o \ - ${OBJECTDIR}/lib/robot.o \ - ${OBJECTDIR}/lib/server.o \ ${OBJECTDIR}/main.o \ ${OBJECTDIR}/tasks.o \ ${OBJECTDIR}/tasks_pthread.o @@ -95,41 +90,16 @@ ${OBJECTDIR}/lib/comrobot.o: lib/comrobot.cpp ${RM} "$@.d" $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/comrobot.o lib/comrobot.cpp -${OBJECTDIR}/lib/image.o: lib/image.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/image.o lib/image.cpp - ${OBJECTDIR}/lib/img.o: lib/img.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/img.o lib/img.cpp -${OBJECTDIR}/lib/message.o: lib/message.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/message.o lib/message.cpp - ${OBJECTDIR}/lib/messages.o: lib/messages.cpp ${MKDIR} -p ${OBJECTDIR}/lib ${RM} "$@.d" $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/messages.o lib/messages.cpp -${OBJECTDIR}/lib/monitor.o: lib/monitor.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/monitor.o lib/monitor.cpp - -${OBJECTDIR}/lib/robot.o: lib/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/robot.o lib/robot.cpp - -${OBJECTDIR}/lib/server.o: lib/server.cpp - ${MKDIR} -p ${OBJECTDIR}/lib - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/lib/server.o lib/server.cpp - ${OBJECTDIR}/main.o: main.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} "$@.d" diff --git a/software/raspberry/superviseur-robot/nbproject/configurations.xml b/software/raspberry/superviseur-robot/nbproject/configurations.xml index 5000c71..8af5799 100644 --- a/software/raspberry/superviseur-robot/nbproject/configurations.xml +++ b/software/raspberry/superviseur-robot/nbproject/configurations.xml @@ -8,14 +8,8 @@ ./lib/camera.h ./lib/commonitor.h ./lib/comrobot.h - ./lib/definitions.h - ./lib/image.h ./lib/img.h - ./lib/message.h ./lib/messages.h - ./lib/monitor.h - ./lib/robot.h - ./lib/server.h ./tasks.h tasks_pthread.h @@ -31,14 +25,9 @@ ./lib/camera.cpp ./lib/commonitor.cpp ./lib/comrobot.cpp - ./lib/image.cpp ./lib/img.cpp ./main.cpp - ./lib/message.cpp ./lib/messages.cpp - ./lib/monitor.cpp - ./lib/robot.cpp - ./lib/server.cpp ./tasks.cpp tasks_pthread.cpp @@ -111,34 +100,14 @@ - - - - - - - - - - - - - - - - - - - - @@ -188,36 +157,14 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -284,36 +231,14 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -377,36 +302,14 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -472,36 +375,14 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/raspberry/superviseur-robot/nbproject/private/private.xml b/software/raspberry/superviseur-robot/nbproject/private/private.xml index 0d03a4e..8db3809 100644 --- a/software/raspberry/superviseur-robot/nbproject/private/private.xml +++ b/software/raspberry/superviseur-robot/nbproject/private/private.xml @@ -2,20 +2,24 @@ 1 - 4 + 3 - file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.h + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/comrobot.h file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/commonitor.h file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/img.h file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/img.cpp - file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/main.cpp file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.h file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp - file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.cpp + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/camera.cpp file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.cpp + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/camera.h + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.h + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/main.cpp + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.cpp diff --git a/software/raspberry/superviseur-robot/nbproject/private/timestamps-10.105.1.13-pi-22 b/software/raspberry/superviseur-robot/nbproject/private/timestamps-10.105.1.13-pi-22 index 25b574d..afbbf65 100644 --- a/software/raspberry/superviseur-robot/nbproject/private/timestamps-10.105.1.13-pi-22 +++ b/software/raspberry/superviseur-robot/nbproject/private/timestamps-10.105.1.13-pi-22 @@ -1,4 +1,4 @@ -#Thu Jan 10 09:07:13 CET 2019 +#Fri Jan 11 09:44:19 CET 2019 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/README.md=c1541685829000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/base64/LICENSE=c1518398687000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/examples/src/uiExample.cpp=c1542120848000 @@ -63,7 +63,7 @@ /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/camera.cpp=c1546940179000 VERSION=1.3 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/CMakeLists.txt=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk=c1547107593000 +/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__Pthread__RPI.mk=c1547195548000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/nbproject/Makefile-variables.mk=c1542029322000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/robot.cpp=c1542105020000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/examples/src/serverTest.cpp=c1542120848000 @@ -83,7 +83,7 @@ VERSION=1.3 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/nbproject/Package-Release.bash=c1541685829000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/main.cpp=c1547047244000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.h=c1546961074000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.cpp=c1547047355000 +/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.cpp=c1547195899000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/img.cpp=c1547041924000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/nbproject/project.xml=c1546856299000 /home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/examples/CMakeLists.txt=c1542120848000 diff --git a/software/raspberry/superviseur-robot/TPRT.Doxyfile b/software/raspberry/superviseur-robot/superviseur.doxygen similarity index 99% rename from software/raspberry/superviseur-robot/TPRT.Doxyfile rename to software/raspberry/superviseur-robot/superviseur.doxygen index ee4bedb..56c51d1 100644 --- a/software/raspberry/superviseur-robot/TPRT.Doxyfile +++ b/software/raspberry/superviseur-robot/superviseur.doxygen @@ -38,7 +38,7 @@ PROJECT_NAME = "Bibliotheques TP RT" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0 +PROJECT_NUMBER = 2.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -58,7 +58,7 @@ PROJECT_LOGO = /home/dimercur/Documents/Travail/git/dumber/software/mo # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./doc +OUTPUT_DIRECTORY = ./docs # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -790,7 +790,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ./ +INPUT = ./lib # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/software/raspberry/superviseur-robot/tasks_pthread.cpp b/software/raspberry/superviseur-robot/tasks_pthread.cpp index 892e0a2..66bb3e0 100644 --- a/software/raspberry/superviseur-robot/tasks_pthread.cpp +++ b/software/raspberry/superviseur-robot/tasks_pthread.cpp @@ -199,7 +199,7 @@ void Tasks::TimerTask(void* arg) { cout << "Start " << __PRETTY_FUNCTION__ << endl << flush; - Camera camera = Camera(sm, 10); + Camera camera = Camera(sm, 20); cout << "Try opening camera" << endl << flush; if (camera.Open()) cout << "Camera opened successfully" << endl << flush; else { @@ -237,9 +237,8 @@ void Tasks::TimerTask(void* arg) { //if (!arena.IsEmpty()) { image.dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME(3)); - list poses = image.SearchAruco(arena); - - //std::list poses = image.SearchRobot(arena); + + std::list poses = image.SearchRobot(arena); cout << "Nbr of pos detected: " << to_string(poses.size()) << endl << flush; if (poses.size() > 0) { diff --git a/software/raspberry/testeur/testeur/.dep.inc b/software/raspberry/testeur/testeur/.dep.inc deleted file mode 100644 index 38ba445..0000000 --- a/software/raspberry/testeur/testeur/.dep.inc +++ /dev/null @@ -1,5 +0,0 @@ -# This code depends on make tool being used -DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES})) -ifneq (${DEPFILES},) -include ${DEPFILES} -endif diff --git a/software/raspberry/testeur/testeur/.gitignore b/software/raspberry/testeur/testeur/.gitignore deleted file mode 100644 index 6debbb8..0000000 --- a/software/raspberry/testeur/testeur/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -build/ -dist/ -.dep.inc - -*.o -*.dep -*.i - diff --git a/software/raspberry/testeur/testeur/Makefile b/software/raspberry/testeur/testeur/Makefile deleted file mode 100644 index 05de621..0000000 --- a/software/raspberry/testeur/testeur/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -# -# There exist several targets which are by default empty and which can be -# used for execution of your targets. These targets are usually executed -# before and after some main targets. They are: -# -# .build-pre: called before 'build' target -# .build-post: called after 'build' target -# .clean-pre: called before 'clean' target -# .clean-post: called after 'clean' target -# .clobber-pre: called before 'clobber' target -# .clobber-post: called after 'clobber' target -# .all-pre: called before 'all' target -# .all-post: called after 'all' target -# .help-pre: called before 'help' target -# .help-post: called after 'help' target -# -# Targets beginning with '.' are not intended to be called on their own. -# -# Main targets can be executed directly, and they are: -# -# build build a specific configuration -# clean remove built files from a configuration -# clobber remove all built files -# all build all configurations -# help print help mesage -# -# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and -# .help-impl are implemented in nbproject/makefile-impl.mk. -# -# Available make variables: -# -# CND_BASEDIR base directory for relative paths -# CND_DISTDIR default top distribution directory (build artifacts) -# CND_BUILDDIR default top build directory (object files, ...) -# CONF name of current configuration -# CND_PLATFORM_${CONF} platform name (current configuration) -# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) -# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) -# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) -# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) -# CND_PACKAGE_NAME_${CONF} name of package (current configuration) -# CND_PACKAGE_PATH_${CONF} path to package (current configuration) -# -# NOCDDL - - -# Environment -MKDIR=mkdir -CP=cp -CCADMIN=CCadmin - - -# build -build: .build-post - -.build-pre: -# Add your pre 'build' code here... - -.build-post: .build-impl -# Add your post 'build' code here... - - -# clean -clean: .clean-post - -.clean-pre: -# Add your pre 'clean' code here... - -.clean-post: .clean-impl -# Add your post 'clean' code here... - - -# clobber -clobber: .clobber-post - -.clobber-pre: -# Add your pre 'clobber' code here... - -.clobber-post: .clobber-impl -# Add your post 'clobber' code here... - - -# all -all: .all-post - -.all-pre: -# Add your pre 'all' code here... - -.all-post: .all-impl -# Add your post 'all' code here... - - -# build tests -build-tests: .build-tests-post - -.build-tests-pre: -# Add your pre 'build-tests' code here... - -.build-tests-post: .build-tests-impl -# Add your post 'build-tests' code here... - - -# run tests -test: .test-post - -.test-pre: build-tests -# Add your pre 'test' code here... - -.test-post: .test-impl -# Add your post 'test' code here... - - -# help -help: .help-post - -.help-pre: -# Add your pre 'help' code here... - -.help-post: .help-impl -# Add your post 'help' code here... - - - -# include project implementation makefile -include nbproject/Makefile-impl.mk - -# include project make variables -include nbproject/Makefile-variables.mk diff --git a/software/raspberry/testeur/testeur/main.cpp b/software/raspberry/testeur/testeur/main.cpp deleted file mode 100644 index 3bdccc8..0000000 --- a/software/raspberry/testeur/testeur/main.cpp +++ /dev/null @@ -1,307 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: main.cpp - * Author: dimercur - * - * Created on 6 novembre 2018, 10:54 - */ - -#include - -#include "image.h" -#include "server.h" -#include "robot.h" -#include "message.h" - -#include -#include -#include -#include - -#include "definitions.h" - -#define HEADER_STM_IMAGE "IMG" // Envoi d'une image -#define HEADER_STM_BAT "BAT" // Envoi de l'état de la batterie -#define HEADER_STM_POS "POS" // Envoi de la position -#define HEADER_STM_NO_ACK "NAK" // Acquittement d'un échec -#define HEADER_STM_ACK "ACK" // Acquittement d'un succès -#define HEADER_STM_MES "MSG" // Message textuel -#define HEADER_STM_LOST_DMB "LCD" // Perte de la communication avec le robot - -#define HEADER_MTS_MSG "MSG" // Message directe pour Console Dumber -#define HEADER_MTS_DMB_ORDER "DMB" // Message d'ordre pour le robot -#define HEADER_MTS_COM_DMB "COM" // Message de gestion de la communication avec le robot -#define HEADER_MTS_CAMERA "CAM" // Message de gestion de la camera -#define HEADER_MTS_STOP "STO" // Message d'arrêt du system - -int socketID; -char data[1000]; -int receivedLength; -bool disconnected = true; -bool dataReady = false; -bool sysTick = false; -bool sendImage = false; -bool sendPos = false; - -Image monImage; -Jpg imageCompressed; -Camera cam; - -typedef struct { - char header[4]; - char data[500]; -} MessageFromMon; - -MessageFromMon *message; -MessageToMon messageAnswered; - -std::thread *threadTimer; -std::thread *threadServer; - -char* imgMsg = NULL; - -using namespace std; - -/* - * - */ -void ThreadServer(void) { - // Recuperation d'une evenutelle commande sur le serveur - while (1) { - receivedLength = receiveDataFromServer(data, 1000); - if (receivedLength > 0) dataReady = true; - } -} - -void ThreadTimer(void) { - struct timespec tim, tim2; - tim.tv_sec = 0; - tim.tv_nsec = 100000000; - int cnt =0; - - while (1) { - //std::this_thread::sleep_for(std::chrono::seconds ) - //sleep(1); - if (nanosleep(&tim, &tim2) < 0) { - printf("Nano sleep system call failed \n"); - return; - } - - cnt++; - - if (cnt>=1) - { - sysTick = true; - cnt=0; - } - } -} - -void printReceivedMessage(MessageFromMon *mes) { - cout << "Received " + to_string(receivedLength) + " data"; - cout << std::endl; - cout << "Header: "; - - for (int i = 0; i < 4; i++) { - cout << mes->header[i]; - } - - cout << std::endl; - cout << "Data: "; - for (int i = 0; i < receivedLength - 4; i++) { - cout << mes->data[i]; - } - - cout << std::endl; -} - -int sendAnswer(string cmd, string data) { - int status = 0; - string msg; - - msg = cmd + ':' + data; - cout << "Answer: " + msg; - cout << std::endl; - sendDataToServer((char*) msg.c_str(), msg.length()); - - return status; -} - -int sendBinaryData(string cmd, char* data, int length) { - int status = 0; - int lengthSend; - - if (imgMsg != NULL) free((void*) imgMsg); - imgMsg = (char*) malloc(length + 4); - imgMsg[0] = cmd[0]; - imgMsg[1] = cmd[1]; - imgMsg[2] = cmd[2]; - imgMsg[3] = ':'; - - memcpy((void*) &imgMsg[4], (const void *) data, length); - cout << "Answer: " + cmd; - cout << std::endl; - - lengthSend=sendDataToServer(imgMsg, length + 4); - - cout << "Requested Length: " + to_string(length) + " / Send Length: " + to_string(lengthSend); - cout << std::endl; - return status; -} - -int decodeMessage(MessageFromMon *mes, int dataLength) { - int status = 0; - string header(mes->header, 4); - string data(mes->data, dataLength); - - if (header.find(HEADER_MTS_COM_DMB) != std::string::npos) // Message pour la gestion du port de communication - { - if (data.find(OPEN_COM_DMB) != std::string::npos) sendAnswer(HEADER_STM_ACK, ""); - else if (data.find(CLOSE_COM_DMB) != std::string::npos) sendAnswer(HEADER_STM_ACK, ""); - } else if (header.find(HEADER_MTS_CAMERA) != std::string::npos) // Message pour la camera - { - if (data.find(CAM_OPEN) != std::string::npos) { - sendAnswer(HEADER_STM_ACK, ""); - sendImage = true; - } else if (data.find(CAM_CLOSE) != std::string::npos) { - sendImage = false; - } else if (data.find(CAM_COMPUTE_POSITION) != std::string::npos) { - sendPos = true; - } else if (data.find(CAM_STOP_COMPUTE_POSITION) != std::string::npos) { - sendPos = false; - } else { - - } - } else if (header.find(HEADER_MTS_DMB_ORDER) != std::string::npos) // Message de com pour le robot - { - if (data.find(DMB_START_WITHOUT_WD) != std::string::npos) { - sendAnswer(HEADER_STM_ACK, ""); - - } else if (data.find(DMB_START_WITH_WD) != std::string::npos) { - sendAnswer(HEADER_STM_ACK, ""); - - } else if (data.find(DMB_GET_VBAT) != std::string::npos) { - sendAnswer(HEADER_STM_BAT, to_string(DMB_BAT_HIGH)); - } else if (data.find(DMB_MOVE) != std::string::npos) { - - } else if (data.find(DMB_TURN) != std::string::npos) { - - } else { - - } - } else if (header.find(HEADER_MTS_STOP) != std::string::npos) // Message d'arret - { - sendAnswer(HEADER_STM_ACK, ""); - } else { - sendAnswer(HEADER_STM_NO_ACK, ""); - } - - return status; -} - -int main(int argc, char** argv) { - - // Ouverture de la com robot -#ifdef __FOR_PC__ - if (open_communication_robot("/dev/ttyUSB0") != 0) { -#else - if (open_communication_robot("/dev/ttyS0") != 0) { -#endif /*__FOR_PC__ */ - cerr << "Unable to open /dev/ttyUSB0: abort"; - cout << std::endl; - return -1; - } - cout << "Com port opened"; - cout << std::endl; - - // Ouverture de la camera - if (open_camera(&cam) == -1) { - cerr << "Unable to open camera: abort"; - cout << std::endl; - - return -1; - } - cout << "Camera opened"; - cout << std::endl; - - // Ouverture du serveur - socketID = openServer(5544); - cout << "Server opened on port 5544"; - cout << std::endl; - - threadTimer = new std::thread(ThreadTimer); - - for (;;) { - cout << "Waiting for client to connect ..."; - cout << std::endl; - acceptClient(); - disconnected = false; - dataReady = false; - cout << "Client connected"; - cout << std::endl; - - threadServer = new std::thread(ThreadServer); - - while (disconnected == false) { - - // Recuperation de l'image - get_image(&cam, &monImage, ""); - - if (dataReady == true) // des données ont été recu par le serveur - { - message = (MessageFromMon*) malloc(sizeof (MessageFromMon)); - memcpy((void*) message, (const void*) data, sizeof (MessageFromMon)); - dataReady = false; - - //if (message->header[4] == ':') message->header[4]; - printReceivedMessage(message); - decodeMessage(message, receivedLength - 4); - - free(message); - } - - if (sysTick) { - sysTick = false; - - if (sendImage) { - compress_image(&monImage, &imageCompressed); - int length = imageCompressed.size(); - sendBinaryData(HEADER_STM_IMAGE, reinterpret_cast (imageCompressed.data()), length); - //sendAnswer(HEADER_STM_IMAGE, reinterpret_cast (imageCompressed.data())); - } - - if (sendPos) { - //sendAnswer(HEADER_STM_POS,) - } - } - } - } - - threadTimer->join(); - threadServer->join(); - - // test de la camera - if (open_camera(0) != -1) { - for (;;) { - get_image(0, &monImage, ""); - - if (monImage.empty()) printf("image vide"); - else { - imshow("Sortie Camera", monImage); - - waitKey(10); - } - } - } else { - printf("Echec ouverture de camera"); - return -1; - } - - return 0; -} - diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-Debug-rpi.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-Debug-rpi.mk deleted file mode 100644 index 7ee9819..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Makefile-Debug-rpi.mk +++ /dev/null @@ -1,107 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a -pre and a -post target defined where you can add customized code. -# -# This makefile implements configuration specific macros and targets. - - -# Environment -MKDIR=mkdir -CP=cp -GREP=grep -NM=nm -CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc -CCC=g++ -CXX=g++ -FC=gfortran -AS=as - -# Macros -CND_PLATFORM=GNU-Linux -CND_DLIB_EXT=so -CND_CONF=Debug-rpi -CND_DISTDIR=dist -CND_BUILDDIR=build - -# Include project Makefile -include Makefile - -# Object Directory -OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} - -# Object Files -OBJECTFILES= \ - ${OBJECTDIR}/_ext/e4d40e25/image.o \ - ${OBJECTDIR}/_ext/e4d40e25/message.o \ - ${OBJECTDIR}/_ext/e4d40e25/robot.o \ - ${OBJECTDIR}/_ext/e4d40e25/server.o \ - ${OBJECTDIR}/main.o - - -# C Compiler Flags -CFLAGS= - -# CC Compiler Flags -CCFLAGS= -CXXFLAGS= - -# Fortran Compiler Flags -FFLAGS= - -# Assembler Flags -ASFLAGS= - -# Link Libraries and Options -LDLIBSOPTIONS=-L/usr/local/lib `pkg-config --libs opencv` -lpthread -lraspicam -lraspicam_cv - -# Build Targets -.build-conf: ${BUILD_SUBPROJECTS} - "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur - -${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur: ${OBJECTFILES} - ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} - ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur ${OBJECTFILES} ${LDLIBSOPTIONS} - -${OBJECTDIR}/_ext/e4d40e25/image.o: ../../superviseur-robot/lib/src/image.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/image.o ../../superviseur-robot/lib/src/image.cpp - -${OBJECTDIR}/_ext/e4d40e25/message.o: ../../superviseur-robot/lib/src/message.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/message.o ../../superviseur-robot/lib/src/message.cpp - -${OBJECTDIR}/_ext/e4d40e25/robot.o: ../../superviseur-robot/lib/src/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/robot.o ../../superviseur-robot/lib/src/robot.cpp - -${OBJECTDIR}/_ext/e4d40e25/server.o: ../../superviseur-robot/lib/src/server.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/server.o ../../superviseur-robot/lib/src/server.cpp - -${OBJECTDIR}/main.o: main.cpp - ${MKDIR} -p ${OBJECTDIR} - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp - -# Subprojects -.build-subprojects: - -# Clean Targets -.clean-conf: ${CLEAN_SUBPROJECTS} - ${RM} -r ${CND_BUILDDIR}/${CND_CONF} - -# Subprojects -.clean-subprojects: - -# Enable dependency checking -.dep.inc: .depcheck-impl - -include .dep.inc diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk deleted file mode 100644 index 5fcde42..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk +++ /dev/null @@ -1,107 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a -pre and a -post target defined where you can add customized code. -# -# This makefile implements configuration specific macros and targets. - - -# Environment -MKDIR=mkdir -CP=cp -GREP=grep -NM=nm -CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc -CCC=g++ -CXX=g++ -FC=gfortran -AS=as - -# Macros -CND_PLATFORM=GNU-Linux -CND_DLIB_EXT=so -CND_CONF=Debug -CND_DISTDIR=dist -CND_BUILDDIR=build - -# Include project Makefile -include Makefile - -# Object Directory -OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} - -# Object Files -OBJECTFILES= \ - ${OBJECTDIR}/_ext/e4d40e25/image.o \ - ${OBJECTDIR}/_ext/e4d40e25/message.o \ - ${OBJECTDIR}/_ext/e4d40e25/robot.o \ - ${OBJECTDIR}/_ext/e4d40e25/server.o \ - ${OBJECTDIR}/main.o - - -# C Compiler Flags -CFLAGS= - -# CC Compiler Flags -CCFLAGS= -CXXFLAGS= - -# Fortran Compiler Flags -FFLAGS= - -# Assembler Flags -ASFLAGS= - -# Link Libraries and Options -LDLIBSOPTIONS=`pkg-config --libs opencv` -lpthread - -# Build Targets -.build-conf: ${BUILD_SUBPROJECTS} - "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur - -${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur: ${OBJECTFILES} - ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} - ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur ${OBJECTFILES} ${LDLIBSOPTIONS} - -${OBJECTDIR}/_ext/e4d40e25/image.o: ../../superviseur-robot/lib/src/image.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -D__FOR_PC__ -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/image.o ../../superviseur-robot/lib/src/image.cpp - -${OBJECTDIR}/_ext/e4d40e25/message.o: ../../superviseur-robot/lib/src/message.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -D__FOR_PC__ -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/message.o ../../superviseur-robot/lib/src/message.cpp - -${OBJECTDIR}/_ext/e4d40e25/robot.o: ../../superviseur-robot/lib/src/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -D__FOR_PC__ -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/robot.o ../../superviseur-robot/lib/src/robot.cpp - -${OBJECTDIR}/_ext/e4d40e25/server.o: ../../superviseur-robot/lib/src/server.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -D__FOR_PC__ -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/server.o ../../superviseur-robot/lib/src/server.cpp - -${OBJECTDIR}/main.o: main.cpp - ${MKDIR} -p ${OBJECTDIR} - ${RM} "$@.d" - $(COMPILE.cc) -g -DD_REENTRANT -D__FOR_PC__ -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp - -# Subprojects -.build-subprojects: - -# Clean Targets -.clean-conf: ${CLEAN_SUBPROJECTS} - ${RM} -r ${CND_BUILDDIR}/${CND_CONF} - -# Subprojects -.clean-subprojects: - -# Enable dependency checking -.dep.inc: .depcheck-impl - -include .dep.inc diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk deleted file mode 100644 index 28c0602..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk +++ /dev/null @@ -1,107 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a -pre and a -post target defined where you can add customized code. -# -# This makefile implements configuration specific macros and targets. - - -# Environment -MKDIR=mkdir -CP=cp -GREP=grep -NM=nm -CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc -CCC=g++ -CXX=g++ -FC=gfortran -AS=as - -# Macros -CND_PLATFORM=GNU-Linux -CND_DLIB_EXT=so -CND_CONF=Release -CND_DISTDIR=dist -CND_BUILDDIR=build - -# Include project Makefile -include Makefile - -# Object Directory -OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} - -# Object Files -OBJECTFILES= \ - ${OBJECTDIR}/_ext/e4d40e25/image.o \ - ${OBJECTDIR}/_ext/e4d40e25/message.o \ - ${OBJECTDIR}/_ext/e4d40e25/robot.o \ - ${OBJECTDIR}/_ext/e4d40e25/server.o \ - ${OBJECTDIR}/main.o - - -# C Compiler Flags -CFLAGS= - -# CC Compiler Flags -CCFLAGS= -CXXFLAGS= - -# Fortran Compiler Flags -FFLAGS= - -# Assembler Flags -ASFLAGS= - -# Link Libraries and Options -LDLIBSOPTIONS= - -# Build Targets -.build-conf: ${BUILD_SUBPROJECTS} - "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur - -${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur: ${OBJECTFILES} - ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} - ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur ${OBJECTFILES} ${LDLIBSOPTIONS} - -${OBJECTDIR}/_ext/e4d40e25/image.o: ../../superviseur-robot/lib/src/image.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/image.o ../../superviseur-robot/lib/src/image.cpp - -${OBJECTDIR}/_ext/e4d40e25/message.o: ../../superviseur-robot/lib/src/message.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/message.o ../../superviseur-robot/lib/src/message.cpp - -${OBJECTDIR}/_ext/e4d40e25/robot.o: ../../superviseur-robot/lib/src/robot.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/robot.o ../../superviseur-robot/lib/src/robot.cpp - -${OBJECTDIR}/_ext/e4d40e25/server.o: ../../superviseur-robot/lib/src/server.cpp - ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/server.o ../../superviseur-robot/lib/src/server.cpp - -${OBJECTDIR}/main.o: main.cpp - ${MKDIR} -p ${OBJECTDIR} - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp - -# Subprojects -.build-subprojects: - -# Clean Targets -.clean-conf: ${CLEAN_SUBPROJECTS} - ${RM} -r ${CND_BUILDDIR}/${CND_CONF} - -# Subprojects -.clean-subprojects: - -# Enable dependency checking -.dep.inc: .depcheck-impl - -include .dep.inc diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk deleted file mode 100644 index 601d1b4..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk +++ /dev/null @@ -1,133 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a pre- and a post- target defined where you can add customization code. -# -# This makefile implements macros and targets common to all configurations. -# -# NOCDDL - - -# Building and Cleaning subprojects are done by default, but can be controlled with the SUB -# macro. If SUB=no, subprojects will not be built or cleaned. The following macro -# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf -# and .clean-reqprojects-conf unless SUB has the value 'no' -SUB_no=NO -SUBPROJECTS=${SUB_${SUB}} -BUILD_SUBPROJECTS_=.build-subprojects -BUILD_SUBPROJECTS_NO= -BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} -CLEAN_SUBPROJECTS_=.clean-subprojects -CLEAN_SUBPROJECTS_NO= -CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} - - -# Project Name -PROJECTNAME=testeur - -# Active Configuration -DEFAULTCONF=Debug -CONF=${DEFAULTCONF} - -# All Configurations -ALLCONFS=Debug Release Debug-rpi - - -# build -.build-impl: .build-pre .validate-impl .depcheck-impl - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf - - -# clean -.clean-impl: .clean-pre .validate-impl .depcheck-impl - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf - - -# clobber -.clobber-impl: .clobber-pre .depcheck-impl - @#echo "=> Running $@..." - for CONF in ${ALLCONFS}; \ - do \ - "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ - done - -# all -.all-impl: .all-pre .depcheck-impl - @#echo "=> Running $@..." - for CONF in ${ALLCONFS}; \ - do \ - "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ - done - -# build tests -.build-tests-impl: .build-impl .build-tests-pre - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf - -# run tests -.test-impl: .build-tests-impl .test-pre - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf - -# dependency checking support -.depcheck-impl: - @echo "# This code depends on make tool being used" >.dep.inc - @if [ -n "${MAKE_VERSION}" ]; then \ - echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \ - echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ - echo "include \$${DEPFILES}" >>.dep.inc; \ - echo "endif" >>.dep.inc; \ - else \ - echo ".KEEP_STATE:" >>.dep.inc; \ - echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ - fi - -# configuration validation -.validate-impl: - @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ - then \ - echo ""; \ - echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ - echo "See 'make help' for details."; \ - echo "Current directory: " `pwd`; \ - echo ""; \ - fi - @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ - then \ - exit 1; \ - fi - - -# help -.help-impl: .help-pre - @echo "This makefile supports the following configurations:" - @echo " ${ALLCONFS}" - @echo "" - @echo "and the following targets:" - @echo " build (default target)" - @echo " clean" - @echo " clobber" - @echo " all" - @echo " help" - @echo "" - @echo "Makefile Usage:" - @echo " make [CONF=] [SUB=no] build" - @echo " make [CONF=] [SUB=no] clean" - @echo " make [SUB=no] clobber" - @echo " make [SUB=no] all" - @echo " make help" - @echo "" - @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," - @echo " also build subprojects." - @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," - @echo " also clean subprojects." - @echo "Target 'clobber' will remove all built files from all configurations and," - @echo " unless 'SUB=no', also from subprojects." - @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," - @echo " also build subprojects." - @echo "Target 'help' prints this message." - @echo "" - diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk deleted file mode 100644 index bd191c9..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -# Generated - do not edit! -# -# NOCDDL -# -CND_BASEDIR=`pwd` -CND_BUILDDIR=build -CND_DISTDIR=dist -# Debug configuration -CND_PLATFORM_Debug=GNU-Linux -CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux -CND_ARTIFACT_NAME_Debug=testeur -CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux/testeur -CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package -CND_PACKAGE_NAME_Debug=testeur.tar -CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/testeur.tar -# Release configuration -CND_PLATFORM_Release=GNU-Linux -CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux -CND_ARTIFACT_NAME_Release=testeur -CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/testeur -CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package -CND_PACKAGE_NAME_Release=testeur.tar -CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/testeur.tar -# Debug-rpi configuration -CND_PLATFORM_Debug-rpi=GNU-Linux -CND_ARTIFACT_DIR_Debug-rpi=dist/Debug-rpi/GNU-Linux -CND_ARTIFACT_NAME_Debug-rpi=testeur -CND_ARTIFACT_PATH_Debug-rpi=dist/Debug-rpi/GNU-Linux/testeur -CND_PACKAGE_DIR_Debug-rpi=dist/Debug-rpi/GNU-Linux/package -CND_PACKAGE_NAME_Debug-rpi=testeur.tar -CND_PACKAGE_PATH_Debug-rpi=dist/Debug-rpi/GNU-Linux/package/testeur.tar -# -# include compiler specific variables -# -# dmake command -ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ - (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) -# -# gmake command -.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) -# -include nbproject/private/Makefile-variables.mk diff --git a/software/raspberry/testeur/testeur/nbproject/Package-Debug-rpi.bash b/software/raspberry/testeur/testeur/nbproject/Package-Debug-rpi.bash deleted file mode 100644 index 3da996c..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Package-Debug-rpi.bash +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -x - -# -# Generated - do not edit! -# - -# Macros -TOP=`pwd` -CND_PLATFORM=GNU-Linux -CND_CONF=Debug-rpi -CND_DISTDIR=dist -CND_BUILDDIR=build -CND_DLIB_EXT=so -NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging -TMPDIRNAME=tmp-packaging -OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur -OUTPUT_BASENAME=testeur -PACKAGE_TOP_DIR=testeur/ - -# Functions -function checkReturnCode -{ - rc=$? - if [ $rc != 0 ] - then - exit $rc - fi -} -function makeDirectory -# $1 directory path -# $2 permission (optional) -{ - mkdir -p "$1" - checkReturnCode - if [ "$2" != "" ] - then - chmod $2 "$1" - checkReturnCode - fi -} -function copyFileToTmpDir -# $1 from-file path -# $2 to-file path -# $3 permission -{ - cp "$1" "$2" - checkReturnCode - if [ "$3" != "" ] - then - chmod $3 "$2" - checkReturnCode - fi -} - -# Setup -cd "${TOP}" -mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package -rm -rf ${NBTMPDIR} -mkdir -p ${NBTMPDIR} - -# Copy files and create directories and links -cd "${TOP}" -makeDirectory "${NBTMPDIR}/testeur/bin" -copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 - - -# Generate tar file -cd "${TOP}" -rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar -cd ${NBTMPDIR} -tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar * -checkReturnCode - -# Cleanup -cd "${TOP}" -rm -rf ${NBTMPDIR} diff --git a/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash b/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash deleted file mode 100644 index 460a865..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -x - -# -# Generated - do not edit! -# - -# Macros -TOP=`pwd` -CND_PLATFORM=GNU-Linux -CND_CONF=Debug -CND_DISTDIR=dist -CND_BUILDDIR=build -CND_DLIB_EXT=so -NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging -TMPDIRNAME=tmp-packaging -OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur -OUTPUT_BASENAME=testeur -PACKAGE_TOP_DIR=testeur/ - -# Functions -function checkReturnCode -{ - rc=$? - if [ $rc != 0 ] - then - exit $rc - fi -} -function makeDirectory -# $1 directory path -# $2 permission (optional) -{ - mkdir -p "$1" - checkReturnCode - if [ "$2" != "" ] - then - chmod $2 "$1" - checkReturnCode - fi -} -function copyFileToTmpDir -# $1 from-file path -# $2 to-file path -# $3 permission -{ - cp "$1" "$2" - checkReturnCode - if [ "$3" != "" ] - then - chmod $3 "$2" - checkReturnCode - fi -} - -# Setup -cd "${TOP}" -mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package -rm -rf ${NBTMPDIR} -mkdir -p ${NBTMPDIR} - -# Copy files and create directories and links -cd "${TOP}" -makeDirectory "${NBTMPDIR}/testeur/bin" -copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 - - -# Generate tar file -cd "${TOP}" -rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar -cd ${NBTMPDIR} -tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar * -checkReturnCode - -# Cleanup -cd "${TOP}" -rm -rf ${NBTMPDIR} diff --git a/software/raspberry/testeur/testeur/nbproject/Package-Release.bash b/software/raspberry/testeur/testeur/nbproject/Package-Release.bash deleted file mode 100644 index acbac81..0000000 --- a/software/raspberry/testeur/testeur/nbproject/Package-Release.bash +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -x - -# -# Generated - do not edit! -# - -# Macros -TOP=`pwd` -CND_PLATFORM=GNU-Linux -CND_CONF=Release -CND_DISTDIR=dist -CND_BUILDDIR=build -CND_DLIB_EXT=so -NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging -TMPDIRNAME=tmp-packaging -OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur -OUTPUT_BASENAME=testeur -PACKAGE_TOP_DIR=testeur/ - -# Functions -function checkReturnCode -{ - rc=$? - if [ $rc != 0 ] - then - exit $rc - fi -} -function makeDirectory -# $1 directory path -# $2 permission (optional) -{ - mkdir -p "$1" - checkReturnCode - if [ "$2" != "" ] - then - chmod $2 "$1" - checkReturnCode - fi -} -function copyFileToTmpDir -# $1 from-file path -# $2 to-file path -# $3 permission -{ - cp "$1" "$2" - checkReturnCode - if [ "$3" != "" ] - then - chmod $3 "$2" - checkReturnCode - fi -} - -# Setup -cd "${TOP}" -mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package -rm -rf ${NBTMPDIR} -mkdir -p ${NBTMPDIR} - -# Copy files and create directories and links -cd "${TOP}" -makeDirectory "${NBTMPDIR}/testeur/bin" -copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 - - -# Generate tar file -cd "${TOP}" -rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar -cd ${NBTMPDIR} -tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar * -checkReturnCode - -# Cleanup -cd "${TOP}" -rm -rf ${NBTMPDIR} diff --git a/software/raspberry/testeur/testeur/nbproject/configurations.xml b/software/raspberry/testeur/testeur/nbproject/configurations.xml deleted file mode 100644 index 97ded86..0000000 --- a/software/raspberry/testeur/testeur/nbproject/configurations.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - ../../superviseur-robot/lib/definitions.h - ../../superviseur-robot/lib/image.h - ../../superviseur-robot/lib/message.h - ../../superviseur-robot/lib/robot.h - ../../superviseur-robot/lib/server.h - - - - - ../../superviseur-robot/lib/src/image.cpp - main.cpp - ../../superviseur-robot/lib/src/message.cpp - ../../superviseur-robot/lib/src/robot.cpp - ../../superviseur-robot/lib/src/server.cpp - - - - - Makefile - - - - ../../superviseur-robot/lib/src - - Makefile - - - - default - true - false - - - - - ../../superviseur-robot/lib - - - __FOR_PC__ - - - - - ../../superviseur-robot/lib - - - D_REENTRANT - __FOR_PC__ - - - - - `pkg-config --libs opencv` - PosixThreads - - - - - - - - - - - - - - - - - - - - - - - - - - - default - true - false - - - - 5 - - - 5 - - - 5 - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - GNU|GNU - true - false - - - - - ../../superviseur-robot/lib - - - __FOR_PC__ - - - - 8 - - ../../superviseur-robot/lib - - - D_REENTRANT - - - - - /usr/local/lib - - - `pkg-config --libs opencv` - PosixThreads - raspicam - raspicam_cv - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk b/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk deleted file mode 100644 index 4327168..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# Generated - do not edit! -# -# NOCDDL -# -# Debug configuration -# Release configuration -# Debug-rpi configuration diff --git a/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c b/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c deleted file mode 100644 index c2548d2..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - */ - -// List of standard headers was taken in http://en.cppreference.com/w/c/header - -#include // Conditionally compiled macro that compares its argument to zero -#include // Functions to determine the type contained in character data -#include // Macros reporting error conditions -#include // Limits of float types -#include // Sizes of basic types -#include // Localization utilities -#include // Common mathematics functions -#include // Nonlocal jumps -#include // Signal handling -#include // Variable arguments -#include // Common macro definitions -#include // Input/output -#include // String handling -#include // General utilities: memory management, program utilities, string conversions, random numbers -#include // Time/date utilities -#include // (since C95) Alternative operator spellings -#include // (since C95) Extended multibyte and wide character utilities -#include // (since C95) Wide character classification and mapping utilities -#ifdef _STDC_C99 -#include // (since C99) Complex number arithmetic -#include // (since C99) Floating-point environment -#include // (since C99) Format conversion of integer types -#include // (since C99) Boolean type -#include // (since C99) Fixed-width integer types -#include // (since C99) Type-generic math (macros wrapping math.h and complex.h) -#endif -#ifdef _STDC_C11 -#include // (since C11) alignas and alignof convenience macros -#include // (since C11) Atomic types -#include // (since C11) noreturn convenience macros -#include // (since C11) Thread library -#include // (since C11) UTF-16 and UTF-32 character utilities -#endif diff --git a/software/raspberry/testeur/testeur/nbproject/private/configurations.xml b/software/raspberry/testeur/testeur/nbproject/private/configurations.xml deleted file mode 100644 index b589ab9..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/configurations.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - Makefile - - - - localhost - 2 - - - - - - - - - - - - - - - gdb - - - - "${OUTPUT_PATH}" - - "${OUTPUT_PATH}" - - true - 0 - 0 - - - - - - - localhost - 2 - - - - - - - - - - - - - - - gdb - - - - "${OUTPUT_PATH}" - - "${OUTPUT_PATH}" - - true - 0 - 0 - - - - - - - pi@10.105.1.13:22 - 2 - - - - - - - - - - - - - - - - - gdb - - - - "${OUTPUT_PATH}" - - "${OUTPUT_PATH}" - - true - 0 - 0 - - - - - - diff --git a/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp b/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp deleted file mode 100644 index 04f6fa6..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - */ - -// List of standard headers was taken in http://en.cppreference.com/w/cpp/header - -#include // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search -#include // Functions and macro constants for signal management -#include // Macro (and function) that saves (and jumps) to an execution context -#include // Handling of variable length argument lists -#include // Runtime type information utilities -#include // std::bitset class template -#include // Function objects, designed for use with the standard algorithms -#include // Various utility components -#include // C-style time/date utilites -#include // typedefs for types such as size_t, NULL and others -#include // Low-level memory management utilities -#include // Higher level memory management utilities -#include // limits of integral types -#include // limits of float types -#include // standardized way to query properties of arithmetic types -#include // Exception handling utilities -#include // Standard exception objects -#include // Conditionally compiled macro that compares its argument to zero -#include // Macro containing the last error number -#include // functions to determine the type contained in character data -#include // functions for determining the type of wide character data -#include // various narrow character string handling functions -#include // various wide and multibyte string handling functions -#include // std::basic_string class template -#include // std::vector container -#include // std::deque container -#include // std::list container -#include // std::set and std::multiset associative containers -#include // std::map and std::multimap associative containers -#include // std::stack container adaptor -#include // std::queue and std::priority_queue container adaptors -#include // Algorithms that operate on containers -#include // Container iterators -#include // Common mathematics functions -#include // Complex number type -#include // Class for representing and manipulating arrays of values -#include // Numeric operations on values in containers -#include // forward declarations of all classes in the input/output library -#include // std::ios_base class, std::basic_ios class template and several typedefs -#include // std::basic_istream class template and several typedefs -#include // std::basic_ostream, std::basic_iostream class templates and several typedefs -#include // several standard stream objects -#include // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs -#include // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs -#include // std::strstream, std::istrstream, std::ostrstream(deprecated) -#include // Helper functions to control the format or input and output -#include // std::basic_streambuf class template -#include // C-style input-output functions -#include // Localization utilities -#include // C localization utilities -#include // empty header. The macros that appear in iso646.h in C are keywords in C++ -#if __cplusplus >= 201103L -#include // (since C++11) std::type_index -#include // (since C++11) Compile-time type information -#include // (since C++11) C++ time utilites -#include // (since C++11) std::initializer_list class template -#include // (since C++11) std::tuple class template -#include // (since C++11) Nested allocator class -#include // (since C++11) fixed-size types and limits of other types -#include // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions -#include // (since C++11) defines std::error_code, a platform-dependent error code -#include // (since C++11) C-style Unicode character conversion functions -#include // (since C++11) std::array container -#include // (since C++11) std::forward_list container -#include // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers -#include // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers -#include // (since C++11) Random number generators and distributions -#include // (since C++11) Compile-time rational arithmetic -#include // (since C++11) Floating-point environment access functions -#include // (since C++11) Unicode conversion facilities -#include // (since C++11) Classes, algorithms and iterators to support regular expression processing -#include // (since C++11) Atomic operations library -#include // (since C++11)(deprecated in C++17) simply includes the header -#include // (since C++11)(deprecated in C++17) simply includes the headers (until C++17) (since C++17) and : the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers -#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant -#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant -#include // (since C++11) std::thread class and supporting functions -#include // (since C++11) mutual exclusion primitives -#include // (since C++11) primitives for asynchronous computations -#include // (since C++11) thread waiting conditions -#endif -#if __cplusplus >= 201300L -#include // (since C++14) shared mutual exclusion primitives -#endif -#if __cplusplus >= 201500L -#include // (since C++17) std::any class template -#include // (since C++17) std::optional class template -#include // (since C++17) std::variant class template -#include // (since C++17) Polymorphic allocators and memory resources -#include // (since C++17) std::basic_string_view class template -#include // (since C++17) Predefined execution policies for parallel versions of the algorithms -#include // (since C++17) std::path class and supporting functions -#endif diff --git a/software/raspberry/testeur/testeur/nbproject/private/downloads-10.105.1.13-pi-22 b/software/raspberry/testeur/testeur/nbproject/private/downloads-10.105.1.13-pi-22 deleted file mode 100644 index e69de29..0000000 diff --git a/software/raspberry/testeur/testeur/nbproject/private/launcher.properties b/software/raspberry/testeur/testeur/nbproject/private/launcher.properties deleted file mode 100644 index 3edc2d8..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/launcher.properties +++ /dev/null @@ -1,42 +0,0 @@ -# Launchers File syntax: -# -# [Must-have property line] -# launcher1.runCommand= -# [Optional extra properties] -# launcher1.displayName= -# launcher1.hide= -# launcher1.buildCommand= -# launcher1.runDir= -# launcher1.runInOwnTab= -# launcher1.symbolFiles= -# launcher1.env.= -# (If this value is quoted with ` it is handled as a native command which execution result will become the value) -# [Common launcher properties] -# common.runDir= -# (This value is overwritten by a launcher specific runDir value if the latter exists) -# common.env.= -# (Environment variables from common launcher are merged with launcher specific variables) -# common.symbolFiles= -# (This value is overwritten by a launcher specific symbolFiles value if the latter exists) -# -# In runDir, symbolFiles and env fields you can use these macroses: -# ${PROJECT_DIR} - project directory absolute path -# ${OUTPUT_PATH} - linker output path (relative to project directory path) -# ${OUTPUT_BASENAME}- linker output filename -# ${TESTDIR} - test files directory (relative to project directory path) -# ${OBJECTDIR} - object files directory (relative to project directory path) -# ${CND_DISTDIR} - distribution directory (relative to project directory path) -# ${CND_BUILDDIR} - build directory (relative to project directory path) -# ${CND_PLATFORM} - platform name -# ${CND_CONF} - configuration name -# ${CND_DLIB_EXT} - dynamic library extension -# -# All the project launchers must be listed in the file! -# -# launcher1.runCommand=... -# launcher2.runCommand=... -# ... -# common.runDir=... -# common.env.KEY=VALUE - -# launcher1.runCommand= \ No newline at end of file diff --git a/software/raspberry/testeur/testeur/nbproject/private/private.xml b/software/raspberry/testeur/testeur/nbproject/private/private.xml deleted file mode 100644 index b87adb5..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/private.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - 1 - 2 - - - - - file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/main.cpp - - - diff --git a/software/raspberry/testeur/testeur/nbproject/private/timestamps-10.105.1.13-pi-22 b/software/raspberry/testeur/testeur/nbproject/private/timestamps-10.105.1.13-pi-22 deleted file mode 100644 index 727d827..0000000 --- a/software/raspberry/testeur/testeur/nbproject/private/timestamps-10.105.1.13-pi-22 +++ /dev/null @@ -1,26 +0,0 @@ -#Mon Nov 12 11:20:04 CET 2018 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/robot.h=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/project.xml=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/robot.cpp=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/image.h=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/main.cpp=c1542017998000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/server.cpp=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/message.cpp=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/.gitignore=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/Makefile=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Makefile-Debug-rpi.mk=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk=c1541775193000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/message.h=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/image.cpp=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Package-Release.bash=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/.dep.inc=c1541685829000 -VERSION=1.3 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/server.h=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/definitions.h=c1541685829000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/nbproject/Package-Debug-rpi.bash=c1542014288000 -/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/monitor.cpp=c1541685829000 diff --git a/software/raspberry/testeur/testeur/nbproject/project.xml b/software/raspberry/testeur/testeur/nbproject/project.xml deleted file mode 100644 index b9da082..0000000 --- a/software/raspberry/testeur/testeur/nbproject/project.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - org.netbeans.modules.cnd.makeproject - - - testeur - - cpp - h - UTF-8 - - - ../../superviseur-robot/lib/src - - - - Debug - 1 - - - Release - 1 - - - Debug-rpi - 1 - - - - false - - - -