Month: June 2014

Converting CAD Parasolid to other formats

I downloaded the Hexapod Parasolid model from http://www.pkm.org.ua/2013/06/cad-model-arrived.html but cannot open it directly on FreeCAD, Blender, etc.

Then after searching for a CAD converter I found CADExchanger:

http://www.cadexchanger.com/download.html

Installed it this way:

$ wine msiexec /i cadexchanger_2.5.1_build4182_setup32.msi

Then entered at installed directory:

$ cd ~/.wine/drive_c/Program Files (x86)/CAD Exchanger/bin

And executed it:

$ wine Exchanger.exe

Then clicked on New, imported the Hexapod.x_t file and converted it to many formats.

Update: A nice open-source software for 3D convertion is called Assimp: http://assimp.sourceforge.net. It doesn’t support Parasolid convertion yet, but I think it could change soon.

Advertisements

Listing all functions name from a project

I was trying to list all functions from a C language project, initially trying with cscope. But I found this post: http://bytes.com/topic/c/answers/222334-list-all-functions-c-files and decided to do it other way.

Lets assume all functions will be something like bla(…), bla_bla(…), bla(_bla)^N, etc.
Then list all lines with this standard:

$ egrep "*[A-Z,a-z,0-1]\(" * > functions.txt

After openning functions.txt I noticed this standard:
file.c: bla…()

Now let us remove “file.c:” using cut command:

cat functions.txt | cut -d: -f2- > functions_nofiles.txt

My initial idea was just remove any text after “(” from this file, but it will not work because casting (i.e. (int) charfunction(); ).

Then I decided to break all lines with empty space, it will remove the casting complexity:

cat functions_nofiles.txt | tr " " "\n" > functions_perlines.txt

Now I just need to remove all lines that doesn’t have “(” :

cat functions_perlines.txt | grep "(" > functions.txt

We need to get only the function name, then of copy name before “(” :

cat functions.txt | cut -d\( -f-1 > realfunctions.txt

After doing it I noticed some *bla, *)bla, !bla, &bla then I just used text editor to replace it.

Finally used sort and uniq command to get a file will all functions.

Listing of open-source Inertial Navigation system

Polaris is an Inertial Navigation software developing in Python mostly to use with X-Plane simulator:
https://github.com/timtrueman/polaris/

INSTK: is a toolkit for Octave/Matlab:
http://www.instk.org/

DynamicTrack is an interface to devices that provide dynamic position/orientation:
https://github.com/XenonofArcticus/DynamicTrack

Inertial Navigation for Robots:
https://code.google.com/p/nav6/

Madgewick sensor fusion:
http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

Gentlenav/MatrixPilot is an IMU system for UDBx boards (found at Sparkfun):
https://code.google.com/p/gentlenav/

Premerlani’s post about his IMU system:
http://diydrones.com/profiles/blogs/a-simple-deadreckoning

OpenShoe:
http://www.openshoe.org

Controlling your TV over CEC HDMI interface

Just to notify some info about how to control your TV over HDMI cable.

I found some info in the arduino forum:
http://forum.arduino.cc/index.php/topic,22327.0.html

It pointed me to:
http://www.andrewncarr.com/hdmi/index.html
https://code.google.com/p/cec-arduino/

Yes, you can control over TV over HDMI cable using an arduino.

More info:
http://elinux.org/CEC_%28Consumer_Electronics_Control%29_over_HDMI

I’m searching for a way to send Closed Caption (CC) signal to TV, but it is not possible using HDMI cable. I think it is possible to send data directly over CEC interface (I²C) and use a board to get this data and show CC in a LED display.