Monthly Archives: March 2015

MATLAB code for Numerical calculation of Jacobian matrix for a complex number

In this post, I share a MATLAB code for numerical calculation of Jacobian matrix for a complex number.

Download

This code was developed by Sithan Kanna, based on my code. If you are just interested in Jacobian of a real number, please see this post.

http://youngmok.com/numerical-jacobian-matrix-matlab/

I really thank to Sithan Kanna for sharing this nice code. If you have a question on this code please send an email to sithankanna a-t gmail d-o-t com

Download

 

This is a sample result of the code

>> h=@(x)[x(1) ; conj(x(1))]; % nonlinear equation

conjug = 0;
real = 0;
x_test = [0.5*1j];
H = NumJacob(h, x_test, conjug, real)

H =

1.0000
-0.0000

 

Have a nice day, and thank you for visiting my blog.

-Mok-

 

—————————————————————————————————

I am Youngmok Yun, and writing about robotics theories and my research.

My main site is http://youngmok.com, and Korean ver. is  http://yunyoungmok.tistory.com.

—————————————————————————————————

 

libstdc++.so.6 error when using cross compiler in debian (e.g. ubuntu)

When I compile a source code for Beaglebone black (arm processor) in my ubuntu 12.04 local computer, I met the following problem.

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

The solution is !!

Copy the below text

” deb http://www.emdebian.org/debian unstable main ”

and, go to the package source folder.  /etc/apt/sources.list.d

Then, paste the text in a source list file (e.g, lubuntu-desktop-ppa-precise.list)

Then update or install all necessary files like this.

# apt-get install build-essential
# apt-get install libc6-armhf-cross
# apt-get install libc6-dev-armhf-cross
# apt-get install binutils-arm-linux-gnueabihf
# apt-get install linux-libc-dev-armhf-cross
# apt-get install libstdc++6-armhf-cross
# apt-get install gcc-4.7-arm-linux-gnueabihf
# apt-get install g++-4.7-arm-linux-gnueabihf

 

I got this solution from a reply of this website.

http://derekmolloy.ie/beaglebone/setting-up-eclipse-on-the-beaglebone-for-c-development/

I really appreciate.

I hope this can help your project.

 

-Mok-

Maxon EPOS2 Driver C++ Class using USB-CAN Gateway for Multiple Motor Actuation

I am sharing a C++ Class for multiple Maxon motor actuation by EPOS2 via USB-Can gateway.

The source code is written for two motors, but it is possible to modify easily to actuate multiple motors.

<Download>

If you want to see a simpler version for one motor actuation, see this article. 

I hope this article makes your life easier.

-Mok-

UDP Server C++ Class with a listening thread


DO NOT USE THIS CODE ANY LONGER. TOO MUCH OUTDATED AND BUGGY


I am sharing a code for “UDP Server C++ Class with a listening thread”. In the class “UDPThread”, a thread is running to receive a UDP packet.

<Download>

Just compile a demo program with this command. Then you will understand.

g++ demo_udp_server.cpp UDPThread.cpp -lpthread -o demo_udp_server

This is the result.

Screenshot from 2015-03-04 15:44:40

<Download>

I hope this code helps your project.

-Mok-