QExtSerialPort Race Condition Found

We found a subtle bug in the latest version of QExtSerialPort (the December 9th, 2012 revision 1349938a5827 version) that could cause memory corruption and an unexpected crash. This bug is subtle because it is seldom triggered. You’ll get it once in a long while if you run a separate thread that continually writes to the serial port. It will eventually trigger a (d->ref == 1) assertion in QList.cpp because of trying to reallocate memory while it is being used elsewhere. One method to find this error immediately is to enable Windows heap and exception handling using Microsoft’s Application Verifier. If you add your application to Application Verifier’s list and then run your application in a debugger, you’ll get an immediate exception in QExtSerialPort.

Continue reading

Qt Mobility QtMultimediaKit vs Phonon

Recently, we had to use a Qt media library for a software consulting project. After doing some research and considering non-Qt libraries or embedding VLC, we decided to use Qt’s native solutions. Several websites (e.g. http://colin.guthr.ie/2010/05/qt-multimediamobility-vs-phonon-fight/) and even Qt (http://doc.qt.digia.com/qtmobility/multimedia.htmlhttp://blog.qt.digia.com/2009/09/09/multimedia-in-qt-whats-the-story/) have mentioned that Phonon is no longer being actively developed and Qt Mobility’s QtMultimediaKit is the way to go. In fact, Phonon will no longer be supported in Qt 5. However, we found out that Qt Mobility may not be quite ready for stable development.

Continue reading

QwtPlot3D Enhancements

We were using QwtPlot3D recently to plot a point cloud. This 3rd-party Qt library is an extension to the popular Qwt library for 3D plotting. It uses OpenGL to create nice 3D plots with user interaction (e.g. rotation and zoom). It also colors the data based on the z-axis values and can automatically fit a mesh to your data. But we ran into a couple of issues with the library that did not work well for us (not including poor documentation). We made slight modifications to the library that greatly improve its speed and made our own colormap class because the default one doesn’t look good. Continue reading

Google Ceres Solver for Windows 64-Bit (Instructions and Binaries)

The Google Ceres Solver is a nonlinear least-squares solver. It’s an efficient library that can be used to solve nonlinear least-squares problems like fitting a cone, sphere or cylinder to a set of 3-dimensional points. If you want some good non-linear least-squares fit equations to use for the solver, you might want to take a look at this. Building the Ceres Solver on Windows, especially x64 Windows, is not a trivial task. Here we give the details necessary for building it from source and also provide 64-bit binaries for your convenience for Ceres Solver version 1.3.0. These instructions were created for the latest versions of the libraries available at the time of its writing. Newer libraries might require changes. These instructions are also specifically for Visual Studio but could be adapted to other compilers. Many of the steps below require a file extraction tool. Our favorite tool for Windows is 7-zip since it’s open source and handles most formats. Continue reading

Small Business Innovation Research (SBIR)

Hammertech Engineering Solution’s main specialty is software consulting for small to medium sized businesses that are working on Small Business Innovation Research (SBIR) projects. We have helped businesses on both their phase 1 and phase 2 work for both small and large funded projects. Our phase 1 work has helped secure our clients phase 2 work and our phase 2 work has helped our clients complete successful demonstrations for continued funding. Continue reading