3/19/2013

C++ linear algebra library -> armadillo

armadillo  -> http://arma.sourceforge.net/






Armadillo expression comparing matlab

~~~~~~~~~~~~~~~~~~~~~
*M :
>> A=[5:9]
A =
     5     6     7     8     9

*A :
 linspace(5, 9, 9-5+1)
5.0 6.0 7.0 8.0 9.0

 linspace(5, 9, 9-5+1)
5 6 7 8 9
~~~~~~~~~~~~~~~~~~~~~
*M
A=[1 2 3; 4 5 6];
>> sum(a,1)

ans =

     5     7     9

>> sum(a,2)

ans =

     6
    15

*A
sum(a, 0)
5 7 9
sum(a,1)
6
15









atan2 function

Thank you.

3/09/2013

SICK LMS511 sensor data acquisition interface (source code, C++/MFC)

This is data acquisition source code of LMS511(SICK co.)



Source code is made by MFC(vs 2008).
The sensor is communicated by TCP/IP.
You can set sensor ip and test running by  sopas program.
The sopas program is included in the manual CD.



This movie is running test video.






LMS511 communication sample code (tcp/ip)

reference here
http://study.marearts.com/2013/03/sick-lms511-sensor-data-acquisition.html

Source code is here(github)
https://github.com/MareArts/LMS511-SICK-Laser-sensor-communication-tcp-ip

youtube
https://www.youtube.com/watch?v=2LTpaDGus1Y


Thank you.

3/04/2013

CString to char *



- CString to char*

1. memcpy
CString str = "test";
unsigned char st[30];
memcpy(st, (unsigned char*)(LPCTSTR)str,str.GetLength());

2. strcpy
CString strData = "test";
int length = strData.GetLength();
char* st = new char[length];
strcpy(st, strData.GetBuffer(0));

3. Type convert
CString str;
str = "test";
char* st = LPSTR(LPCTSTR(str));


- char* to CString
Using Format function in CString class
char st[] = "test";
CString str;
str.Format("%s", st);