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.
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.
I really appreciate.
I hope this can help your project.
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.
If you want to see a simpler version for one motor actuation, see
I hope this article makes your life easier.
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.
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.
I hope this code helps your project.
Minimal c++ class for Maxon EPOS2
I am sharing the minimal C++ class for Maxon EPOS2. It includes a basic “initialization”, “Move”, “Read position”, “Close device” functions. The program consists of a class called “cmaxonmotor”. You can download the class and demo program here
You can see a simple demo program here.
using namespace std;
int main(int argc, char *argv)
motor.initializeDevice(); // initialize EPOS2
long TargetPosition = -200000;
int CurrentPosition = 0;
motor.Move(TargetPosition); // move to the target position
cout << "Press <Enter> to stop and quit..." << endl;
motor.GetCurrentPosition(CurrentPosition); // get the current position
cout << "Current Position: " << CurrentPosition << endl;
motor.closeDevice(); // close EPOS2
You can control one motor just via USB, and also able to control multiple motors via USB-CAN gateway. For this version, see
I hope this helps your project.
This entry was posted in
Control, Linux, Programming and tagged c++, can, code, epos2, gateway, maxon, motor, usb on . February 26, 2015
< Simplest Bidirectional UDP Program in Labview >
Today, I am sharing the s
implest bidirectional UDP program made for Labview
I have tried to find a simple birectional UDP program, but it was not easy. Most of programs were incomplete. So I made the thinnest program for only bidirectional UDP communication.
The program is based on the examples provided by NI.
You can download the program at
<Download>. The below is screenshots of the program.
I hope this helps your projects.
Recently I met a problem while opening Dynamixel motors with USBDynamixel like the below picture.
My environment is Ubuntu 12.04 and patched with RT-preempted to make my PC real-time.
The solution is very simple, just use “
sudo“. You can see the result in the below picture.
This code is the simplest code to measure a program execution time more precisely.
It is using “struct timeval”.
double getTimeElapsed(struct timeval end, struct timeval start)
return (end.tv_sec - start.tv_sec) + (end.tv_usec - start.tv_usec) / 1000000.00;
struct timeval tvalBefore, tvalAfter;
// Do something here, this is the simplest program to measure the elapsed time. It is more precise than simple ctimer
double time_elapsed = getTimeElapsed(tvalAfter, tvalBefore);
I have referred the below two sites
Good luck ^_^