rajouts des commentaires (Demande #35)

Creation d'une classe imageWidget dans le moniteur (demande #43)
modifications du comportement des fleches dans le moniteur (demande #41)
Suppression de relicats anciens
This commit is contained in:
Sébastien DI MERCURIO 2019-01-15 16:25:48 +01:00
parent f7a46fbb4b
commit a18aaca4d7
68 changed files with 964 additions and 4069 deletions

2
aruco_markers/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.png
*.jpg

View file

@ -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

Binary file not shown.

Binary file not shown.

View file

@ -62,20 +62,10 @@ namespace monitor
/// </summary>
private static byte[] buffer = new byte[BufferMaxSize];
/// <summary>
/// buffer containing received message from TCP server
/// Used to concatenate internal buffers into one
/// </summary>
//private static byte[] receiveBuffer;
//private static int initialReceiveBufferIndex = 0;
/// <summary>
/// String containing received message from tcp server
/// </summary>
private static StringBuilder message = new StringBuilder();
//private static int newLength = 1;
//private static int packetCounter = 0;
/// <summary>
/// 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);

View file

@ -19,6 +19,9 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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";
}
/// <summary>
/// Commands used for robot messages
/// </summary>
//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";
//}
/// <summary>
/// Specialization class for command manager, which implemnent destijl protocol between monitor and server
/// </summary>
@ -409,17 +371,84 @@ namespace monitor
}
/// <summary>
/// Move robot forward or backward, for a distance expressed in millimeter
/// Move robot forward for an unlimited distance
/// </summary>
/// <returns>Command status (see DecodeStatus)</returns>
/// <param name="distance">Distance of mouvment, in millimeter</param>
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);
}
/// <summary>
/// Move robot backward for an unlimited distance
/// </summary>
/// <returns>Command status (see DecodeStatus)</returns>
public CommandStatus RobotGoBackward()
{
CommandManager.CommandManagerStatus localStatus;
string answer;
localStatus = commandManager.SendCommand(
CreateCommand(DestijlCommandList.ROBOT_GO_BACKWARD),
out answer,
0);
return DecodeStatus(localStatus, answer);
}
/// <summary>
/// Turn robot to the left for an unlimited number of turn
/// </summary>
/// <returns>Command status (see DecodeStatus)</returns>
public CommandStatus RobotGoLeft()
{
CommandManager.CommandManagerStatus localStatus;
string answer;
localStatus = commandManager.SendCommand(
CreateCommand(DestijlCommandList.ROBOT_GO_LEFT),
out answer,
0);
return DecodeStatus(localStatus, answer);
}
/// <summary>
/// Turn robot to the right for an unlimited number of turn
/// </summary>
/// <returns>Command status (see DecodeStatus)</returns>
public CommandStatus RobotGoRight()
{
CommandManager.CommandManagerStatus localStatus;
string answer;
localStatus = commandManager.SendCommand(
CreateCommand(DestijlCommandList.ROBOT_GO_RIGHT),
out answer,
0);
return DecodeStatus(localStatus, answer);
}
/// <summary>
/// Stop robot mouvement
/// </summary>
/// <returns>Command status (see DecodeStatus)</returns>
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 = ",";

View file

@ -0,0 +1,304 @@
//
// ImageWidget.cs
//
// Author:
// Di MERCURIO Sébastien <dimercur@insa-toulouse.fr>
//
// 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 <http://www.gnu.org/licenses/>.
// 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
{
/// <summary>
/// Class used for video display
/// </summary>
public class ImageWidget
{
/// <summary>
/// Reference to GTK base widget
/// </summary>
private DrawingArea drawingArea;
/// <summary>
/// Pixbuffer used for displaying image
/// </summary>
private Pixbuf drawingareaCameraPixbuf;
/// <summary>
/// Indicate if position must be displayed or not
/// </summary>
public bool showPosition;
/// <summary>
/// Indicate if FPS must be displayed or not
/// </summary>
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();
}
}
}
/// <summary>
/// Counter used for FPS computation
/// </summary>
private int imageFPS = 0;
private int imageFPScounter = 0;
/// <summary>
/// Timer for FPS request
/// </summary>
private System.Timers.Timer fpsTimer;
/// <summary>
/// Hold position to be displayed
/// </summary>
private DestijlCommandManager.Position position;
public DestijlCommandManager.Position Position
{
get
{
return position;
}
set
{
position = value;
Refresh();
}
}
/// <summary>
/// Request a refresh of drawing area
/// </summary>
private void Refresh()
{
Gtk.Application.Invoke(delegate
{
drawingArea.QueueDraw();
});
}
/// <summary>
/// Initializes a new instance of ImageWidget class.
/// </summary>
/// <param name="area">Reference to GTK drawing area widget</param>
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;
}
/// <summary>
/// Show an image from a ressource
/// </summary>
/// <param name="ressource">Ressource path</param>
public void ShowImage(string ressource)
{
drawingareaCameraPixbuf = Pixbuf.LoadFromResource("monitor.ressources.missing_picture.png");
imageFPScounter++;
Refresh();
}
/// <summary>
/// Show an image from a byte array
/// </summary>
/// <param name="image">Byte array containing a valid image</param>
public void ShowImage(byte[] image)
{
drawingareaCameraPixbuf = new Pixbuf(image);
imageFPScounter++;
Refresh();
}
/// <summary>
/// Callback called when drawingarea need refresh
/// </summary>
/// <param name="o">Sender object</param>
/// <param name="args">Expose arguments</param>
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();
}
}
/// <summary>
/// Timer used for FPS computation
/// </summary>
/// <param name="sender">Sender object</param>
/// <param name="e">unused parameter</param>
private void OnFpsTimerElapsed(object sender, ElapsedEventArgs e)
{
imageFPS = imageFPScounter;
imageFPScounter = 0;
Refresh();
}
}
}

View file

@ -19,6 +19,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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
/// </summary>
private DestijlCommandManager cmdManager;
/// <summary>
/// Pixbuffer used for displaying image
/// </summary>
private Pixbuf drawingareaCameraPixbuf;
/// <summary>
/// Position used for displaying position
/// </summary>
@ -63,20 +63,21 @@ public partial class MainWindow : Gtk.Window
/// </summary>
private SystemState systemState = SystemState.NotConnected;
/// <summary>
/// Object used for displaying image on a valid DrawingArea widget
/// </summary>
private ImageWidget imageWidget;
/// <summary>
/// Timer for battery request
/// </summary>
private System.Timers.Timer batteryTimer;
/// <summary>
/// Counter for image reception and detecting bad picture ratio
/// </summary>
private int imageReceivedCounter = 0;
private int badImageReceivedCounter = 0;
private int imageFPS = 0;
private int imageFPScounter = 0;
/// <summary>
/// Timer for FPS request
/// </summary>
private System.Timers.Timer fpsTimer;
/// <summary>
/// Initializes a new instance of the <see cref="MainWindow"/> 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;
}
}
}
/// <summary>
/// Callback called when drawingarea need refresh
/// </summary>
/// <param name="o">Sender object</param>
/// <param name="args">Expose arguments</param>
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;
}
/// <summary>
@ -766,7 +658,7 @@ public partial class MainWindow : Gtk.Window
}
/// <summary>
/// Callback called when "detect Arena " button is clicked
/// Callback called when "Detect Arena" button is clicked
/// </summary>
/// <param name="sender">Sender object</param>
/// <param name="e">Event</param>
@ -785,32 +677,13 @@ public partial class MainWindow : Gtk.Window
DetectArena();
}
/// <summary>
/// Callback function for FPS checkbutton
/// </summary>
/// <param name="sender">Sender object</param>
/// <param name="e">unused paramter</param>
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;
}
}

View file

@ -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);

View file

@ -170,7 +170,6 @@
<child>
<widget class="Gtk.DrawingArea" id="drawingAreaCamera">
<property name="MemberName" />
<signal name="ExposeEvent" handler="OnDrawingAreaCameraExposeEvent" />
</widget>
<packing>
<property name="Position">1</property>
@ -610,12 +609,10 @@
<child>
<placeholder />
</child>
<child>
<placeholder />
</child>
<child>
<widget class="Gtk.Button" id="buttonDown">
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Move robot backward</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">resource:monitor.ressources.pan-down-symbolic.symbolic.png</property>
@ -642,6 +639,7 @@
<child>
<widget class="Gtk.Button" id="buttonForward">
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Move robot forward</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">resource:monitor.ressources.pan-up-symbolic.symbolic.png</property>
@ -666,6 +664,7 @@
<child>
<widget class="Gtk.Button" id="buttonLeft">
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Turn robot to the left</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">resource:monitor.ressources.pan-start-symbolic.symbolic.png</property>
@ -690,6 +689,7 @@
<child>
<widget class="Gtk.Button" id="buttonRight">
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Turn robot to the right</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">resource:monitor.ressources.pan-end-symbolic.symbolic.png</property>
@ -713,6 +713,33 @@
<property name="YShrink">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="buttonStop">
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Stop robot movements</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">resource:monitor.ressources.hand-filled-32.png</property>
<property name="Label" translatable="yes" />
<property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnButtonMouvClicked" />
</widget>
<packing>
<property name="TopAttach">1</property>
<property name="BottomAttach">2</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
<property name="YFill">True</property>
<property name="YShrink">False</property>
</packing>
</child>
</widget>
</child>
</widget>

Binary file not shown.

View file

@ -70,6 +70,7 @@
<EmbeddedResource Include="ressources\robot-icon.png" />
<EmbeddedResource Include="ressources\robot-icon.resized.png" />
<EmbeddedResource Include="ressources\missing_picture.png" />
<EmbeddedResource Include="ressources\hand-filled-32.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="gtk-gui\generated.cs" />
@ -80,6 +81,7 @@
<Compile Include="Client.cs" />
<Compile Include="CommandManager.cs" />
<Compile Include="DestijlCommandManager.cs" />
<Compile Include="ImageWidget.cs" />
</ItemGroup>
<ItemGroup>
<None Include="afterBuild.sh" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

View file

@ -9,3 +9,6 @@ Makefile
*.cmake
CMakeCache.txt
docs/
doc/

View file

@ -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")

View file

@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="ProjDestijl"/>
<Option makefile_is_custom="1"/>
<Option compiler="gcc"/>
<Option virtualFolders="CMake Files\;CMake Files\lib\;CMake Files\superviseur\;"/>
<Build>
<Target title="all">
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 all"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 rebuild_cache"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot"/>
<Option type="4"/>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 edit_cache"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="destijl">
<Option output="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/lib/libdestijl.a" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib"/>
<Option object_output="./"/>
<Option type="2"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/."/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 destijl"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="destijl/fast">
<Option output="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/lib/libdestijl.a" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib"/>
<Option object_output="./"/>
<Option type="2"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/."/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 destijl/fast"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="superviseur">
<Option output="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur/bin/superviseur" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/../superviseur/bin"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/./src"/>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/../lib"/>
<Add directory="/usr/xenomai/include"/>
<Add directory="/usr/xenomai/include/mercury"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 superviseur"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="superviseur/fast">
<Option output="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur/bin/superviseur" prefix_auto="0" extension_auto="0"/>
<Option working_dir="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/../superviseur/bin"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Compiler>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/./src"/>
<Add directory="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/../lib"/>
<Add directory="/usr/xenomai/include"/>
<Add directory="/usr/xenomai/include/mercury"/>
</Compiler>
<MakeCommands>
<Build command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 superviseur/fast"/>
<CompileFile command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 &quot;$file&quot;"/>
<Clean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 clean"/>
<DistClean command="/usr/bin/make -f &quot;/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/Makefile&quot; VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/image.cpp">
<Option target="destijl"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/message.cpp">
<Option target="destijl"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/monitor.cpp">
<Option target="destijl"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/src/robot.cpp">
<Option target="destijl"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/functions.cpp">
<Option target="superviseur"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/functions.h">
<Option target="superviseur"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/main.cpp">
<Option target="superviseur"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/CMakeLists.txt">
<Option virtualFolder="CMake Files\lib\"/>
</Unit>
<Unit filename="/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/CMakeLists.txt">
<Option virtualFolder="CMake Files\superviseur\"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View file

@ -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"
}
]

View file

@ -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})

View file

@ -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"<<endl<<flush;
cout << "Camera warmup 2sec" << endl << flush;
sleep(2);
cout<<"Start capture"<<endl<<flush;
status =true;
cout << "Start capture" << endl << flush;
status = true;
}
#endif /* __FOR_PC__ */
return status;
}
/**
* Close and release camera
*/
void Camera::Close() {
this->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;
}

View file

@ -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;
};

View file

@ -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 {

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 */

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 <iostream>
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<vector<Point> > contours;
vector<Point> approx;
vector<Vec4i> 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<vector<Point> > contours;
vector<Point> approx;
vector<Vec4i> 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;
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef _IMAGE_H_
#define _IMAGE_H_
#ifndef __STUB__
#ifndef __FOR_PC__
#include <raspicam/raspicam_cv.h>
#else
#include <opencv2/highgui/highgui.hpp>
#endif /* __FOR_PC__ */
#else
#include <opencv2/highgui/highgui.hpp>
#endif
#include "opencv2/imgproc/imgproc.hpp"
#include <unistd.h>
#include <math.h>
#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<unsigned char> 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 é 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_

View file

@ -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<cv::Point2f> 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<cv::Point2f> aruco) {
return ((aruco[0] + aruco[1]) / 2);
}
#endif // __WITH_ARUCO__
std::list<Position> 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<Position> Img::SearchRobot(Arena arena) {
#ifdef __WITH_ARUCO__
ImageMat imgTraitment;
std::list<Position> positionList;
cv::Point2f areneCoor;
std::vector<int> ids;
std::vector<std::vector<cv::Point2f> > corners;
if (arena.IsEmpty())
imgTraitment = this->img.clone();
else {
@ -72,7 +140,7 @@ std::list<Position> 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<Position> 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<Position> Img::SearchRobot(Arena arena) {
#else
std::list<Position> robotsFind;
std::vector<std::vector<cv::Point> > contours;
std::vector<cv::Point> approx;
@ -168,8 +221,14 @@ std::list<Position> 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<std::vector<cv::Point> > contours;
std::vector<cv::Point> 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<Position> 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);
}

View file

@ -29,64 +29,181 @@
#ifdef __WITH_ARUCO__
#include <opencv2/aruco/dictionary.hpp>
#include <opencv2/aruco/charuco.hpp>
//#include <opencv2/aruco.hpp>
#include <opencv2/core/mat.hpp>
#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<unsigned char> 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<Position> 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<Position> SearchRobot(Arena arena);
#ifdef __WITH_ARUCO__
list<Position> SearchAruco(Arena arena);
/**
* Dictionary to be used for aruco recognition
*/
cv::Ptr<cv::aruco::Dictionary> 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<cv::Point2f> aruco);
/**
* Find direction of given aruco
* @param aruco Aruco coordinates
* @return Orientation of aruco
*/
cv::Point2f FindArucoDirection(std::vector<cv::Point2f> 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);
};

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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);
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
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 */

View file

@ -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;

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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;
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#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 é 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_

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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<taille;i++)
{
resultat^=msg[i];
}
return resultat;
}

View file

@ -1,79 +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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>
#include <stdlib.h>
#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_

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#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<char*> (image->data()), image->size());
lengthSend=sendDataToServer(imgMsg, image->size() + 4);
return status;
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
/**
* \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_ */

View file

@ -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"

View file

@ -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:

View file

@ -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:

View file

@ -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"

View file

@ -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"

View file

@ -8,14 +8,8 @@
<itemPath>./lib/camera.h</itemPath>
<itemPath>./lib/commonitor.h</itemPath>
<itemPath>./lib/comrobot.h</itemPath>
<itemPath>./lib/definitions.h</itemPath>
<itemPath>./lib/image.h</itemPath>
<itemPath>./lib/img.h</itemPath>
<itemPath>./lib/message.h</itemPath>
<itemPath>./lib/messages.h</itemPath>
<itemPath>./lib/monitor.h</itemPath>
<itemPath>./lib/robot.h</itemPath>
<itemPath>./lib/server.h</itemPath>
<itemPath>./tasks.h</itemPath>
<itemPath>tasks_pthread.h</itemPath>
</logicalFolder>
@ -31,14 +25,9 @@
<itemPath>./lib/camera.cpp</itemPath>
<itemPath>./lib/commonitor.cpp</itemPath>
<itemPath>./lib/comrobot.cpp</itemPath>
<itemPath>./lib/image.cpp</itemPath>
<itemPath>./lib/img.cpp</itemPath>
<itemPath>./main.cpp</itemPath>
<itemPath>./lib/message.cpp</itemPath>
<itemPath>./lib/messages.cpp</itemPath>
<itemPath>./lib/monitor.cpp</itemPath>
<itemPath>./lib/robot.cpp</itemPath>
<itemPath>./lib/server.cpp</itemPath>
<itemPath>./tasks.cpp</itemPath>
<itemPath>tasks_pthread.cpp</itemPath>
</logicalFolder>
@ -111,34 +100,14 @@
</item>
<item path="./lib/comrobot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/definitions.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/image.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/img.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/img.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/message.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/message.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/messages.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/messages.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/monitor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/monitor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/robot.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/robot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/server.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/server.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./main.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./tasks.cpp" ex="false" tool="1" flavor2="0">
@ -188,36 +157,14 @@
</item>
<item path="./lib/comrobot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/definitions.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/image.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/image.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/img.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/img.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/message.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/message.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/messages.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/messages.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/monitor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/monitor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/robot.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/robot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/server.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/server.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./main.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./tasks.cpp" ex="false" tool="1" flavor2="0">
@ -284,36 +231,14 @@
</item>
<item path="./lib/comrobot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/definitions.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/image.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/image.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/img.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/img.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/message.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/message.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/messages.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/messages.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/monitor.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/monitor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/robot.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/robot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/server.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/server.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./main.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./tasks.cpp" ex="false" tool="1" flavor2="0">
@ -377,36 +302,14 @@
</item>
<item path="./lib/comrobot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/definitions.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/image.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/image.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/img.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="./lib/img.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/message.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/message.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/messages.cpp" ex="false" tool="1" flavor2="9">
</item>
<item path="./lib/messages.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/monitor.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/monitor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/robot.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/robot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/server.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/server.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./main.cpp" ex="false" tool="1" flavor2="9">
</item>
<item path="./tasks.cpp" ex="true" tool="1" flavor2="9">
@ -472,36 +375,14 @@
</item>
<item path="./lib/comrobot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/definitions.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/image.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/image.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/img.cpp" ex="false" tool="1" flavor2="8">
</item>
<item path="./lib/img.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/message.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/message.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/messages.cpp" ex="false" tool="1" flavor2="9">
</item>
<item path="./lib/messages.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/monitor.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/monitor.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/robot.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/robot.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./lib/server.cpp" ex="true" tool="1" flavor2="9">
</item>
<item path="./lib/server.h" ex="false" tool="3" flavor2="0">
</item>
<item path="./main.cpp" ex="false" tool="1" flavor2="9">
</item>
<item path="./tasks.cpp" ex="true" tool="1" flavor2="9">

View file

@ -2,20 +2,24 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>4</activeConfIndexElem>
<activeConfIndexElem>3</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/comrobot.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/commonitor.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/img.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/img.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/main.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/camera.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/camera.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/tasks_pthread.h</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/main.cpp</file>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/messages.cpp</file>
</group>
</open-files>
</project-private>

View file

@ -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

View file

@ -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

View file

@ -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<Position> poses = image.SearchAruco(arena);
//std::list<Position> poses = image.SearchRobot(arena);
std::list<Position> poses = image.SearchRobot(arena);
cout << "Nbr of pos detected: " << to_string(poses.size()) << endl << flush;
if (poses.size() > 0) {

View file

@ -1,5 +0,0 @@
# This code depends on make tool being used
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

View file

@ -1,8 +0,0 @@
build/
dist/
.dep.inc
*.o
*.dep
*.i

View file

@ -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

View file

@ -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 <cstdlib>
#include "image.h"
#include "server.h"
#include "robot.h"
#include "message.h"
#include <iostream>
#include <string>
#include <time.h>
#include <thread>
#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<char*> (imageCompressed.data()), length);
//sendAnswer(HEADER_STM_IMAGE, reinterpret_cast<char*> (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;
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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=<CONFIGURATION>] [SUB=no] build"
@echo " make [CONF=<CONFIGURATION>] [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 ""

View file

@ -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

View file

@ -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}

View file

@ -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}

View file

@ -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}

View file

@ -1,275 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="100">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../../superviseur-robot/lib/definitions.h</itemPath>
<itemPath>../../superviseur-robot/lib/image.h</itemPath>
<itemPath>../../superviseur-robot/lib/message.h</itemPath>
<itemPath>../../superviseur-robot/lib/robot.h</itemPath>
<itemPath>../../superviseur-robot/lib/server.h</itemPath>
</logicalFolder>
<logicalFolder name="ResourceFiles"
displayName="Resource Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../superviseur-robot/lib/src/image.cpp</itemPath>
<itemPath>main.cpp</itemPath>
<itemPath>../../superviseur-robot/lib/src/message.cpp</itemPath>
<itemPath>../../superviseur-robot/lib/src/robot.cpp</itemPath>
<itemPath>../../superviseur-robot/lib/src/server.cpp</itemPath>
</logicalFolder>
<logicalFolder name="TestFiles"
displayName="Test Files"
projectFiles="false"
kind="TEST_LOGICAL_FOLDER">
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>../../superviseur-robot/lib/src</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="Debug" type="1">
<toolsSet>
<compilerSet>default</compilerSet>
<dependencyChecking>true</dependencyChecking>
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<compileType>
<cTool>
<incDir>
<pElem>../../superviseur-robot/lib</pElem>
</incDir>
<preprocessorList>
<Elem>__FOR_PC__</Elem>
</preprocessorList>
</cTool>
<ccTool>
<incDir>
<pElem>../../superviseur-robot/lib</pElem>
</incDir>
<preprocessorList>
<Elem>D_REENTRANT</Elem>
<Elem>__FOR_PC__</Elem>
</preprocessorList>
</ccTool>
<linkerTool>
<linkerLibItems>
<linkerOptionItem>`pkg-config --libs opencv`</linkerOptionItem>
<linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
</linkerLibItems>
</linkerTool>
</compileType>
<item path="../../superviseur-robot/lib/definitions.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/image.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/message.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/robot.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/server.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/image.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/message.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/robot.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/server.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="main.cpp" ex="false" tool="1" flavor2="0">
</item>
</conf>
<conf name="Release" type="1">
<toolsSet>
<compilerSet>default</compilerSet>
<dependencyChecking>true</dependencyChecking>
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<compileType>
<cTool>
<developmentMode>5</developmentMode>
</cTool>
<ccTool>
<developmentMode>5</developmentMode>
</ccTool>
<fortranCompilerTool>
<developmentMode>5</developmentMode>
</fortranCompilerTool>
<asmTool>
<developmentMode>5</developmentMode>
</asmTool>
</compileType>
<item path="../../superviseur-robot/lib/definitions.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/image.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/message.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/robot.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/server.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/image.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/message.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/robot.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/server.cpp"
ex="false"
tool="1"
flavor2="0">
</item>
<item path="main.cpp" ex="false" tool="1" flavor2="0">
</item>
</conf>
<conf name="Debug-rpi" type="1">
<toolsSet>
<compilerSet>GNU|GNU</compilerSet>
<dependencyChecking>true</dependencyChecking>
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<compileType>
<cTool>
<incDir>
<pElem>../../superviseur-robot/lib</pElem>
</incDir>
<preprocessorList>
<Elem>__FOR_PC__</Elem>
</preprocessorList>
</cTool>
<ccTool>
<standard>8</standard>
<incDir>
<pElem>../../superviseur-robot/lib</pElem>
</incDir>
<preprocessorList>
<Elem>D_REENTRANT</Elem>
</preprocessorList>
</ccTool>
<linkerTool>
<linkerAddLib>
<pElem>/usr/local/lib</pElem>
</linkerAddLib>
<linkerLibItems>
<linkerOptionItem>`pkg-config --libs opencv`</linkerOptionItem>
<linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
<linkerLibLibItem>raspicam</linkerLibLibItem>
<linkerLibLibItem>raspicam_cv</linkerLibLibItem>
</linkerLibItems>
</linkerTool>
</compileType>
<item path="../../superviseur-robot/lib/definitions.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/image.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/message.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/robot.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/server.h"
ex="false"
tool="3"
flavor2="0">
</item>
<item path="../../superviseur-robot/lib/src/image.cpp"
ex="false"
tool="1"
flavor2="8">
</item>
<item path="../../superviseur-robot/lib/src/message.cpp"
ex="false"
tool="1"
flavor2="8">
</item>
<item path="../../superviseur-robot/lib/src/robot.cpp"
ex="false"
tool="1"
flavor2="8">
</item>
<item path="../../superviseur-robot/lib/src/server.cpp"
ex="false"
tool="1"
flavor2="8">
</item>
<item path="main.cpp" ex="false" tool="1" flavor2="8">
</item>
</conf>
</confs>
</configurationDescriptor>

View file

@ -1,8 +0,0 @@
#
# Generated - do not edit!
#
# NOCDDL
#
# Debug configuration
# Release configuration
# Debug-rpi configuration

View file

@ -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 <assert.h> // Conditionally compiled macro that compares its argument to zero
#include <ctype.h> // Functions to determine the type contained in character data
#include <errno.h> // Macros reporting error conditions
#include <float.h> // Limits of float types
#include <limits.h> // Sizes of basic types
#include <locale.h> // Localization utilities
#include <math.h> // Common mathematics functions
#include <setjmp.h> // Nonlocal jumps
#include <signal.h> // Signal handling
#include <stdarg.h> // Variable arguments
#include <stddef.h> // Common macro definitions
#include <stdio.h> // Input/output
#include <string.h> // String handling
#include <stdlib.h> // General utilities: memory management, program utilities, string conversions, random numbers
#include <time.h> // Time/date utilities
#include <iso646.h> // (since C95) Alternative operator spellings
#include <wchar.h> // (since C95) Extended multibyte and wide character utilities
#include <wctype.h> // (since C95) Wide character classification and mapping utilities
#ifdef _STDC_C99
#include <complex.h> // (since C99) Complex number arithmetic
#include <fenv.h> // (since C99) Floating-point environment
#include <inttypes.h> // (since C99) Format conversion of integer types
#include <stdbool.h> // (since C99) Boolean type
#include <stdint.h> // (since C99) Fixed-width integer types
#include <tgmath.h> // (since C99) Type-generic math (macros wrapping math.h and complex.h)
#endif
#ifdef _STDC_C11
#include <stdalign.h> // (since C11) alignas and alignof convenience macros
#include <stdatomic.h> // (since C11) Atomic types
#include <stdnoreturn.h> // (since C11) noreturn convenience macros
#include <threads.h> // (since C11) Thread library
#include <uchar.h> // (since C11) UTF-16 and UTF-32 character utilities
#endif

View file

@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="100">
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="Debug" type="1">
<toolsSet>
<developmentServer>localhost</developmentServer>
<platform>2</platform>
</toolsSet>
<dbx_gdbdebugger version="1">
<gdb_pathmaps>
</gdb_pathmaps>
<gdb_interceptlist>
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
</gdb_interceptlist>
<gdb_options>
<DebugOptions>
</DebugOptions>
</gdb_options>
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
</dbx_gdbdebugger>
<nativedebugger version="1">
<engine>gdb</engine>
</nativedebugger>
<runprofile version="9">
<runcommandpicklist>
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
</runcommandpicklist>
<runcommand>"${OUTPUT_PATH}"</runcommand>
<rundir></rundir>
<buildfirst>true</buildfirst>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
<conf name="Release" type="1">
<toolsSet>
<developmentServer>localhost</developmentServer>
<platform>2</platform>
</toolsSet>
<dbx_gdbdebugger version="1">
<gdb_pathmaps>
</gdb_pathmaps>
<gdb_interceptlist>
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
</gdb_interceptlist>
<gdb_options>
<DebugOptions>
</DebugOptions>
</gdb_options>
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
</dbx_gdbdebugger>
<nativedebugger version="1">
<engine>gdb</engine>
</nativedebugger>
<runprofile version="9">
<runcommandpicklist>
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
</runcommandpicklist>
<runcommand>"${OUTPUT_PATH}"</runcommand>
<rundir></rundir>
<buildfirst>true</buildfirst>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
<conf name="Debug-rpi" type="1">
<toolsSet>
<developmentServer>pi@10.105.1.13:22</developmentServer>
<platform>2</platform>
</toolsSet>
<dbx_gdbdebugger version="1">
<gdb_pathmaps>
</gdb_pathmaps>
<gdb_interceptlist>
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
</gdb_interceptlist>
<gdb_signals>
</gdb_signals>
<gdb_options>
<DebugOptions>
</DebugOptions>
</gdb_options>
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
</dbx_gdbdebugger>
<nativedebugger version="1">
<engine>gdb</engine>
</nativedebugger>
<runprofile version="9">
<runcommandpicklist>
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
</runcommandpicklist>
<runcommand>"${OUTPUT_PATH}"</runcommand>
<rundir></rundir>
<buildfirst>true</buildfirst>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

View file

@ -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 <cstdlib> // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
#include <csignal> // Functions and macro constants for signal management
#include <csetjmp> // Macro (and function) that saves (and jumps) to an execution context
#include <cstdarg> // Handling of variable length argument lists
#include <typeinfo> // Runtime type information utilities
#include <bitset> // std::bitset class template
#include <functional> // Function objects, designed for use with the standard algorithms
#include <utility> // Various utility components
#include <ctime> // C-style time/date utilites
#include <cstddef> // typedefs for types such as size_t, NULL and others
#include <new> // Low-level memory management utilities
#include <memory> // Higher level memory management utilities
#include <climits> // limits of integral types
#include <cfloat> // limits of float types
#include <limits> // standardized way to query properties of arithmetic types
#include <exception> // Exception handling utilities
#include <stdexcept> // Standard exception objects
#include <cassert> // Conditionally compiled macro that compares its argument to zero
#include <cerrno> // Macro containing the last error number
#include <cctype> // functions to determine the type contained in character data
#include <cwctype> // functions for determining the type of wide character data
#include <cstring> // various narrow character string handling functions
#include <cwchar> // various wide and multibyte string handling functions
#include <string> // std::basic_string class template
#include <vector> // std::vector container
#include <deque> // std::deque container
#include <list> // std::list container
#include <set> // std::set and std::multiset associative containers
#include <map> // std::map and std::multimap associative containers
#include <stack> // std::stack container adaptor
#include <queue> // std::queue and std::priority_queue container adaptors
#include <algorithm> // Algorithms that operate on containers
#include <iterator> // Container iterators
#include <cmath> // Common mathematics functions
#include <complex> // Complex number type
#include <valarray> // Class for representing and manipulating arrays of values
#include <numeric> // Numeric operations on values in containers
#include <iosfwd> // forward declarations of all classes in the input/output library
#include <ios> // std::ios_base class, std::basic_ios class template and several typedefs
#include <istream> // std::basic_istream class template and several typedefs
#include <ostream> // std::basic_ostream, std::basic_iostream class templates and several typedefs
#include <iostream> // several standard stream objects
#include <fstream> // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs
#include <sstream> // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs
#include <strstream> // std::strstream, std::istrstream, std::ostrstream(deprecated)
#include <iomanip> // Helper functions to control the format or input and output
#include <streambuf> // std::basic_streambuf class template
#include <cstdio> // C-style input-output functions
#include <locale> // Localization utilities
#include <clocale> // C localization utilities
#include <ciso646> // empty header. The macros that appear in iso646.h in C are keywords in C++
#if __cplusplus >= 201103L
#include <typeindex> // (since C++11) std::type_index
#include <type_traits> // (since C++11) Compile-time type information
#include <chrono> // (since C++11) C++ time utilites
#include <initializer_list> // (since C++11) std::initializer_list class template
#include <tuple> // (since C++11) std::tuple class template
#include <scoped_allocator> // (since C++11) Nested allocator class
#include <cstdint> // (since C++11) fixed-size types and limits of other types
#include <cinttypes> // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions
#include <system_error> // (since C++11) defines std::error_code, a platform-dependent error code
#include <cuchar> // (since C++11) C-style Unicode character conversion functions
#include <array> // (since C++11) std::array container
#include <forward_list> // (since C++11) std::forward_list container
#include <unordered_set> // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers
#include <unordered_map> // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers
#include <random> // (since C++11) Random number generators and distributions
#include <ratio> // (since C++11) Compile-time rational arithmetic
#include <cfenv> // (since C++11) Floating-point environment access functions
#include <codecvt> // (since C++11) Unicode conversion facilities
#include <regex> // (since C++11) Classes, algorithms and iterators to support regular expression processing
#include <atomic> // (since C++11) Atomic operations library
#include <ccomplex> // (since C++11)(deprecated in C++17) simply includes the header <complex>
#include <ctgmath> // (since C++11)(deprecated in C++17) simply includes the headers <ccomplex> (until C++17)<complex> (since C++17) and <cmath>: the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers
#include <cstdalign> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
#include <cstdbool> // (since C++11)(deprecated in C++17) defines one compatibility macro constant
#include <thread> // (since C++11) std::thread class and supporting functions
#include <mutex> // (since C++11) mutual exclusion primitives
#include <future> // (since C++11) primitives for asynchronous computations
#include <condition_variable> // (since C++11) thread waiting conditions
#endif
#if __cplusplus >= 201300L
#include <shared_mutex> // (since C++14) shared mutual exclusion primitives
#endif
#if __cplusplus >= 201500L
#include <any> // (since C++17) std::any class template
#include <optional> // (since C++17) std::optional class template
#include <variant> // (since C++17) std::variant class template
#include <memory_resource> // (since C++17) Polymorphic allocators and memory resources
#include <string_view> // (since C++17) std::basic_string_view class template
#include <execution> // (since C++17) Predefined execution policies for parallel versions of the algorithms
#include <filesystem> // (since C++17) std::path class and supporting functions
#endif

View file

@ -1,42 +0,0 @@
# Launchers File syntax:
#
# [Must-have property line]
# launcher1.runCommand=<Run Command>
# [Optional extra properties]
# launcher1.displayName=<Display Name, runCommand by default>
# launcher1.hide=<true if lancher is not visible in menu, false by default>
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
# launcher1.runInOwnTab=<false if launcher reuse common "Run" output tab, true by default>
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
# (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=<Run Directory>
# (This value is overwritten by a launcher specific runDir value if the latter exists)
# common.env.<Environment variable KEY>=<Environment variable VALUE>
# (Environment variables from common launcher are merged with launcher specific variables)
# common.symbolFiles=<Symbol Files loaded by debugger>
# (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=<type your run command here>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>2</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/testeur/testeur/main.cpp</file>
</group>
</open-files>
</project-private>

View file

@ -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

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>testeur</name>
<c-extensions/>
<cpp-extensions>cpp</cpp-extensions>
<header-extensions>h</header-extensions>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>../../superviseur-robot/lib/src</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>Debug</name>
<type>1</type>
</confElem>
<confElem>
<name>Release</name>
<type>1</type>
</confElem>
<confElem>
<name>Debug-rpi</name>
<type>1</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>