- Ange Albertini put together a fantastic overview of the Windows Portable Executable (PE) file format. He also has a great page on x86 oddities.
- OS Dev has a short tutorial on writing an Operating System kernel in the D programming language
- Leo Meyerovich and Ari Rabkin have an amazing interactive visualization and comparison of different programming languages
- If you haven't visited Rosetta Code for a while there are now a very large comparison of programming tasks in multiple languages
- Google Blocky is a visual web-based programming language. Drag & drop function blocks together.
- LuaJIT is a just in time compiler for Lua.
- Lua Development Kit is a eclipse plugin to provide a Lua IDE.
- Microsoft have relased Roslyn compiler API letting you interact with the Microsoft compilers intermediary language.
- Marc Feeley wrote a one file tiny c compiler.
- Clang has a free Static Analyzer for C and Objective C programs. (has XCode support).
- Andy Wingo wrote an indepth post inspecting the Google V8 javascript optimizing compiler
- SLOCCount is a neat tool for calculating the number of Lines of Code in your project, and other metrics. Other great tools for software metrics and code counting are CCCC, CMT and the C metrics collection.
- LCOV is a graphical front-end for the gcov code coverage testing tool.
- Very Sleepy windows profiler v0.8 has been released.
- Lucas van Dijk has a short tutorial on threads with C++11
- The Google Chrome Framework is quite comprehensive and multiplatform.
- Folly (Facebook Open Source Library) provides a number of extensions over the STL and C++11.
- The POCO library provides a solid framework for applications with signal/slots, zip, cryptography, database, logging, networking, and multiprocessing functions. The basic and complete editions are free and open source, however the professional edition is commercial.
- Ian Boyd has a great post on Hasing functions. Murmur hash gives good results as it is fast to compute and results in very few collisions. (CRC32 provides less collisions though)
- Santhosh Kumar wrote an interesting post on exact string match using the Burrows Wheeler transform, which includes a good visual description of the BWT (used often for compression).
- John Cook has a small collection of random number generators for C++, C# and Python including gamma, Weibull, Chi-square, Student-t, Cauchy, etc, etc.
- miniz is a single file compression library for ZLIB, ZIP and PNG files.
- XZ Embedded is a small decompressor for the XZ file format for embedded platforms.
- μSynergy is a lightweight embedded client for Synergy (mouse sharing).
- Quinten Lansu wrote a fantastic tutorial on serialisation using Google's Protobuf
- Some nice examples of how to generate various google maps including geocodes, events, markers, routes, etc.
- Steve Hanov has a post on A/B testing.
- The Unity test framework for C is fairly easy to use.
- AlgoWiki has a nice collection of algorithms
- And finally, David Joyner, Minh Van Nguyen, and Nathann Cohen have released an free open source book on graph algorithms covering everyones favourites from Dijkstra and Floyd-Roy-Warshall to Huffman codes, Priority queues, and specific problems such as graph coloring and travelling salesman.
Sunday, August 05, 2012
Programming links
Well overdue for a catchup post on the non-graphics programming side of things, so here we go:
Tuesday, July 31, 2012
Mid year point
Well, its a bit over the mid year point, and the blog posts have been lower than usual.
There are a number of things that I will do longer posts on, which have happened in the last six months:
- The WAMbot Journal of Field Robotics article was accepted and published, which has been the subject of a number of previous posts on MAGIC2010. I've put together a few posts on the navigation system (A*, Elastic bands, DWA), but still nothing on the system architecture, hardware, exploration, AI, HMI, comms, SLAM, and overall experiences. So plenty of material left to go.
- A paper on the Navigation system has been accepted for publication.
- A paper on using Physics Abstraction Layer for evolving robot control programs has been accepted for publication.
- I finally uploaded the code to ImprovCV and SubSim.
- I gave a guest lecture on realtime raytracing with WebGL, and another on intelligent systems and automation in mining
- I've been doing a little bit of HTML5 and three.js work, which hopefully will turn into a few posts
- As per usual, I've been collecting a large list of interesting links from around the web, that will form a number of catchup posts.
Thursday, June 07, 2012
GPU Technology Conference 2012
nVidia's GPU Technology Conference is over, and a number of presentation slides have been uploaded. There were a quite a few interesting talks relating to graphics, robotics and simulation:
- Simon Green from nVidia and Christopher Horvath from Pixar presented 'Flame On: Real-Time Fire Simulation for Video Games'. It starts with a recent history of research on CG fluid systems, and gives five tips on better looking fire: 1. Get the colors right (e.g. radiation model), 2. Use high quality advection (not just bilinear filtering), 3. Post process with glow and motion blur. 4. Add noise. 5. Add light scattering and embers. They then go into more detail on Tip #1 looking at the physics behind the black-body radiation in a fire, and the color spectrum.
- Elmar Westphal of PGI/JCNS-TA Scientific IT-Systems presented 'Multiparticle Collision Dynamics on one or more GPUs', about multiparticle collision dynamics GPU code. He starts by explaining the overall algorithm, and explaining step-by-step what performs well on the GPU. Specific GPU optimisations explained include spatial subdivision lists, reordering particles in memory, hash collisions, and finally dividing workload between multiple GPU's. An interesting read.
- Michal Januszewski from the University of Silesia in Katowice introduces 'Sailfish: Lattice Boltzmann Fluid Simulations with GPUs and Python'. He explains lattice boltzmann fluid simulation, and some of the different configurations of lattice connectivity and collision operators. Moves into code generation examples, and gives a brief explanation of how the GPU implementation works.
- Nikos Sismanis, Nikos Pitsianis and Xiaobai Sun (Aristotle University, Duke University) cover 'Efficient k-NN Search Algorithms on GPUs'. Starts with an overview of sorting and K-Nearest Neighbour (KNN) search algorithm solutions, including ANN (approximate NN) and lshkit and moves into results including a comparison of thrust::sort with Truncated Bitonic sort. Software is available at http://autogpu.ee.auth.gr/.
- Thomas True of nVidia explains 'Best Practices in GPU-Based Video Processing' and covers overlapping copy-to-host and copy-to-device operations, and an example of processing bayer pattern images.
- Scott Rostrup, Shweta Srivastava, and Kishore Singhal from Synopsys Inc. explain 'Tree Accumulations on GPU' using parallel scatter, parallel reduce and parallel scan algorithms.
- Wil Braithwaite from nVidia presents an interesting talk on 'Interacting with Huge Particle Simulations in Maya using the GPU'. He begins with a brief runthrough of the workings of the CUDA SPH example, and then moves onto the particle system including Maya's body forces (uniform, radial, vortex), shape representations (implicit, covex hull, signed distance fields, displacement maps), collision response, SPH equations, and finally data transfer. Ends with a brief overview of rendering the particles in screen space. Neat.
- David McAllister and James Bigler (nVidia) cover the OptiX internals in 'OptiX Out-of-Core and CPU Rendering' including PTX code generation and optimisation, and converting the OptiX backend to support CPU's via Ocelot and LLVM. An interesting result, LLVM does better at optimising "megafunctions" than small functions, but not entirely unexpected given how LLVM works. The presentation finishes with an overview of paging and a tip on bounding volume heirarchies. Good to see Ocelot in the mainstream.
- Eric Enderton and Morgan McGuire from nVidia explain 'Stochastic Rasterization' (ala 'screen door transparency' rendering) via MSAA for motion blur, depth of field and order-independent transparency, by using a geometry shader to bound the shape and motion of each tri in screen space, and setting up the MSAA masks. Nice.
- Cliff Woolley presents 'Profiling and Tuning OpenACC Code' (by adding pragmas to C / Fortran code, ala OpenMP) using an example of Jacobi iteration, and there were a number of other talks on the topic.
- Christopher Bergström introduced 'PathScale ENZO' the alternative to CUDA and OpenCL.
- Phillip Miller from nVidia did an broad coverage of 'GPU Ray Tracing'. He starts with a myths and claimed facts on GPU raytracing, highlights some commercial GPU raytracers (and the open source OpenCL LuxRenderer) and goes into some details that are better explained in the OptiX Out-of-Core presentation.
- Phillip Miller follows with 'Advanced Rendering Solutions' where he takes a look at nVidia's iray, and where they believe they can introduce new capabilities for design studios and find a middle ground with re-lighting and physcially based rendering.
- Peter Messmer presents 'CUDA Libraries and Ecosystem Overview', where he provides an overview of the linear algebra cuBLAS and cuSPARSE libraries performance, then moves to signal processing with cuFFT and NPP/VSIP for image processing, next is random numbers via cuRAND and finally ties things up with Thrust.
- Jeremie Papon and Alexey Abramov discuss the 'Oculus real-time modular cognitive visual system' including GPU accelerated stereo disparity matching, likelihood maps and image segmentation with a parallel metropolis algorithm.
- Jérôme Graindorge and Julien Houssay from Alyotech present 'Real Time GPU-Based Maritime Scenes Simulation' beginning with ocean simulation and rendering from FFT based wave simulation using HF and LF heightmap components. They then cover rendering the mesh, scene illumination and tone mapping, and a sneak peak at boat interaction. The ocean simulation video is neat.
- Dan Negrut from the Simulation-Based Engineering Lab at the University of Wisconsin–Madison gives an overview of the labs multibody dynamics work in 'From Sand Dynamics to Tank Dynamics' including friction, compliant bodies, multi-physics (fluid/solid interactions), SPH, GPU solution to the cone complementary problem, ellipsoid-ellipsoid CCD, multi-CPU simulation, and finally vehicle track simulation in sand. Wow. Code is available on the Simulation-Based Engineering Lab website.
- Max Rietmann of USI Lugano looks at seismology (earthquake simulation) in 'Faster Finite Elements for Wave Propagation Codes' and describes parallising FEM methods for GPUs in SPECFEM3D.
- Dustin Franklin from GE introduces GE's MilSpec ruggedised Kepler-based GPU solutions and Concurrent Redhawk6 in 'Sensor Processing with Rugged Kepler GPUs'. Looks at some example applications including hyperspectral imaging, mosaicing, 360 degree vision, synthetic aperture radar processing, and space-time adaptive processing for moving target identification.
- Graham Sanborn of FunctionBay presents 'Particle Dynamics with MBD and FEA Using CUDA' and gives a brief overview of their combined CPU/GPU multi-body FEA system and briefly describes the contact, contact force, and integration steps.
- Ritesh Patel and Jason Mak of University of California-Davis cover the Burrows-Wheeler Transform, Move-to-Front Transform and Huffman Coding in 'Lossless Data Compression on GPUs'. They find merge sort for BWT performs best on the GPU, explain the parallel MTF transform and Huffman in illustrative detail and tie things up with benchmarks, unfortunately GPU is 2.78x slower than CPU.
- Nikolai Sakharnykh and Nikolay Markovskiy from NVIDIA provide an indepth explanation of their GPU implementation of solving ADI with tridiagonal systems in '3D ADI Method for Fluid Simulation on Multiple GPUs'.
- Enrico Mastrostefano, Massimo Bernaschi, and Massimiliano Fatica investigate breadth first search in 'Large Graph on multi-GPUs' and describe how best to parallelise it across multiple GPU's by using adjacency lists and level frontiers to minimise the data exchange.
- Bob Zigon from Beckman Coulter presents '1024 bit Parallel Rational Arithmetic Operators for the GPU' and covers exact 1024 bit rational arithmetic (add,sub,mul,div) for the GPU. Get the 1024 bit arithmetic code here.
- Roman Sokolov and Andrei Tchouprakov of D4D Technologies discuss 'Warped parallel nearest neighbor searches using kd-trees' where they take a SIMD style approach by grouping tree searches via voting (ballot)
- David Luebke from nVidia takes a broad look at CG in 'Computational Graphics: An Overview of Graphics Research @ NVIDIA' and provides an overview of research which is featured in a number of previous talks and other GTC talks including edge aware shading, ambient occlusion via volumes and raycasting, stochastic rendering, improved image sampling and reconstruction, global illumination, and CUDA based rasterization.
- Johanna Beyer and Markus Hadwiger from King Abdullah University of Science and Technology discuss 'Terascale Volume Visualization in Neuroscience' where each cubic mm of the brain scanned with an electron microscope generates 800 tereabytes of data. The idea here is to leverage the virtual memory manager to do all the intelligent caching work, rather than a specialised spatial datastructure for the volume rendering.
- Mark Kilgard introduces the NV_path_rendering extension in 'GPU-Accelerated Path Rendering', and demonstrates using the GPU to render PDF, flash, clipart, etc. Contains some sample code.
- Janusz Będkowski from the Warsaw University of Technology presented 'Parallel Computing In Mobile Robotics For RISE' a full GPGPU solution for processing mobile robot laser scan data through to navigation. Starts with data registration into a decomposed grid which is then used for scan matching with point-to-point Iterative Closest Point. Next is estimating surface normals using principle component analysis, demonstrated on velodyne datasets. This is used to achieve point-to-plane ICP and he demonstrates a 6D SLAM loop-closure. Finishes it all off with a simple gradient based GPU path planner.
Wednesday, May 09, 2012
Graphics links post
Its been a while since I've done a link post, (almost five months) so time to catch up!
From the demoscene and WebGL world we have:
- Google released WebGL 3d graphs
- Moleman 2 demoscene documentary trailer, and the documentaries themselves.
- Jochen Wilhelmy (Digi/Alcatraz) gave a talk at Revision on Exporting 3D scenes from Maya to WebGL using clang and llvm with Inka3d.
- The Plasticator open source 64k demo tool
- In an attempt to out-do themselves, Farbrausch released the code to Werkkzeug4
- Nop Jiarathanakul has a collection of source code at github on raymarching distance fields in WebGL
- Sway4k WebGL demo
- Rocket synchronises music and events/parmateres with a number of interpolation modes.
- WebGL particle love hearts, very pretty.
- Martti Nurmikari's demoscene source code for Brainstorm demos
- Riccardo Gerosa wrote a nice post on raymarching ocean waves with WebGL
- It's worth visiting the WebCL website as it is being constantly updated with new examples from Samsung and Nokia.
- The Opera guide to WebGL
- Iñigo Quílez has a lovely video on making music with maths.
- Fabien Sanglard posted a code review of Another World with a nice explanation of the VM and graphics, well worth a read!
- AltDev posted AltDevConf videos, including videos on PowerVR, Dynamic GI, Behaviour Trees, C#, Influence AI, and more.
- Prince of Persia source code found, you can download the PoP code for Apple II.
- Angry Fish Studios has a visual post on representing tilemaps efficiently with bitmasks
- Gijs-Jan Roelofs posted code and an explanation on generating laser FX in OpenGL
- Angelo Pesce has an interesting post onnormal maps
- A short list of free 3d games models
- Haaf's 2d Game Engine has a Haaf's Game Engine unix port.
- Crytek presentations. Enough said.
- Insomniac games research page.
- The Valve handbook for new employees and Michael Abrash's post on working at Valve.
- On the lighter side, a bearded dragon playing the ant crusher game
- A link collection of all the SIGGRAPH course notes
- PowerVR articles on everything from OpenRL (open ray tracing library) to PVR texture compression and parallax bumpmapping. A mini (PowerVR) version of ATI and nVidia's article and tools collection.
- GNU Plotting covers tips and tricks for generating graphs and plots with GNU plot.
- Autodesk's free photofly lets you create 3d models from photos.
- Insight3D is an open source image based modeling (3D models from photos) software package.
- openFrameworks is a cross-platform C++ toolkit for making realtime visual productions, interfacing to OpenGL, GLEW, FMOD, FreeType, Quicktime, etc.
- FXGen is an open source procedural texture generator.
- libnoise is an open source noise (e.g. perlin) generator.
- Robert Schneider maintains a list of mesh generation software for all your triangulation and surface, grid, tetrahedron generation needs.
- Cyril Crassin posted his thesis on GigaVoxels.
- 3D voxel sculpting with 3d-coat.
- Sculptris is 3D sculpting software, similar to Zbrush.
- AN IMAging Library supports a number of file formats, and also simple image operations such as distance transforms.
- Pedro Felzenszwalb has some image distance transform code
- Sander van Rossen's open source Winforms library for node/graph based user interfaces.
- The batman equation.
- An interesting timeline of 3D in movies
- Andy Sloane explains his Donut ascii renderer and provides the code for the curious.
- A short youtube presentation on how your eye works and blindspots
- Take the online color challenge, how well can you see hue?
Tuesday, May 08, 2012
Dynamic Window Algorithm motion planning
Most robots have a set of navigation algorithms for motion planning that execute at different frequencies, global path planners (e.g. A*, ~0.1 Hz), mid-level path deformation (e.g. elastic band, ~5Hz), and collision / obstacle avoidance algorithms (~20Hz), which will be the last step before actuator control.
For MAGIC 2010, we used the Dynamic Window Approach.
(Note the ROS navigation stack offers the same algorithm configurations, but of-course didn't exist at the time we had to develop the WAMbot codebase). There are three common approaches used for local trajectory planning:
There are two main goals, calculate a valid velocity search space, and select the optimal velocity. The search space is constructed from the set of velocities which produce a safe trajectory (i.e. allow the robot to stop before colliding), given the set of velocities the robot can achieve in the next time slice given its dynamics ('dynamic window'). The optimal velocity is selected to maximize the robots clearance, maximize the velocity and obtain the heading closest to the goal.
Its easier to explain if we look at the code first. In pseudo-code the DWA is:
For MAGIC 2010, we used the Dynamic Window Approach.
(Note the ROS navigation stack offers the same algorithm configurations, but of-course didn't exist at the time we had to develop the WAMbot codebase). There are three common approaches used for local trajectory planning:
- Potential-field based, where each obstacle has an obstacle 'force field' for repelling the robot, and the goal has a attraction field. (A similar approach is 'Vector-fields', and Virtual Force Field)
- Dynamics based, where the algorithm consider the robots dynamics in calculating a solution. (e.g. Velocity Obstacles and Dynamic Window Approach)
- Sampling based, where various collision free states are sampled and then combined. (e.g. Reachability graph, Probabilistic roadmaps)
There are two main goals, calculate a valid velocity search space, and select the optimal velocity. The search space is constructed from the set of velocities which produce a safe trajectory (i.e. allow the robot to stop before colliding), given the set of velocities the robot can achieve in the next time slice given its dynamics ('dynamic window'). The optimal velocity is selected to maximize the robots clearance, maximize the velocity and obtain the heading closest to the goal.
Its easier to explain if we look at the code first. In pseudo-code the DWA is:
BEGIN DWA(robotPose,robotGoal,robotModel)
desiredV = calculateV(robotPose,robotGoal)
laserscan = readScanner()
allowable_v = generateWindow(robotV, robotModel)
allowable_w = generateWindow(robotW, robotModel)
for each v in allowable_v
for each w in allowable_w
dist = find_dist(v,w,laserscan,robotModel)
breakDist = calculateBreakingDistance(v)
if (dist > breakDist) //can stop in time
heading = hDiff(robotPose,goalPose, v,w)
clearance = (dist-breakDist)/(dmax - breakDist)
cost = costFunction(heading,clearance, abs(desired_v - v))
if (cost > optimal)
best_v = v
best_w = w
optimal = cost
set robot trajectory to best_v, best_w
END
Now to explain:
- First, we can calculate the desired velocity to the goal based on our current position, and the destination. (e.g. go fast if we are far away, slow if we are close. Use Equations of Motion, see Circular motion for a mobile robot).
- Select the allowable velocities (linear 'v', and angular 'w') given the vehicles dynamics, e.g. allowable_v ranges from the current velocity subtract the robots maximum deceleration * timeslice to the current velocity plus the robots maximum acceleration * timeslice, or more compact: [v-a.t,v+a.t], likewise for angular velocity.
- Search through all the allowable velocities
- For each velocity, determine the closest obstacle for the proposed robot velocity (i.e. collision detection along the trajectory)
- Determine if the distance to the closest obstacle is within the robots breaking distance. If the robot will not be able to stop in time, disregard this proposed robot velocity.
- Otherwise, the velocity is 'admissible', so we can now calculate the values required for the objective function. In our case, the robots heading and clearance.
- Calculate the 'cost' for the proposed velocity. If the cost is better than anything else so far, set this as our best option.
- Finally, set the robots desired trajectory to the best proposed velocity.
Monday, April 16, 2012
Transmin Rocklogic wins WAITTA 2012 Innovation Award
Transmin's rockbreaker automation product, Rocklogic, has won the 2012 WAITTA Innovation award.
ScienceWA covered the story.
Rocklogic features a number of world-first innovations, including tight integration with vehicle automation products allowing the rockbreaker to efficiently interleave operations with haul trucks or loaders. In addition, Rocklogic is the first system for hydraulic booms to allow automated parking and deploy, as well as an active collision avoidance system.
It's been the product of many hours of hard work to bring to market, so it is fantastic to receive this recognition.
On to the nationals!
ScienceWA covered the story.
Rocklogic features a number of world-first innovations, including tight integration with vehicle automation products allowing the rockbreaker to efficiently interleave operations with haul trucks or loaders. In addition, Rocklogic is the first system for hydraulic booms to allow automated parking and deploy, as well as an active collision avoidance system.
It's been the product of many hours of hard work to bring to market, so it is fantastic to receive this recognition.
On to the nationals!
Sunday, April 15, 2012
Farbraush Demo Tools
Farbrausch released the source code to all their demo tools, including kkrunchy, ktg and werkkzeug3. And following the move, Moppi Productions released the Demopaja source code. A good day for demoscene coders.
For more info on these tools take a look at the Demopaja documentation and werkkzeug3 documentation. (FYI, werkkzeug is a german/elite-speak word for "tool", or literally a work-thing). Dirk Jagdmann has a nice online presentation on the Farbraush/Elitegroup demotool approach, and Dierk 'Chaos' Ohlerich has a number of good presentations:
For more info on these tools take a look at the Demopaja documentation and werkkzeug3 documentation. (FYI, werkkzeug is a german/elite-speak word for "tool", or literally a work-thing). Dirk Jagdmann has a nice online presentation on the Farbraush/Elitegroup demotool approach, and Dierk 'Chaos' Ohlerich has a number of good presentations:
- A history of Farbrausch tools at Assembly 2003. (avi download)
- A workshop of .werkkzeug1 at Assembly 2004. (avi download)
- From .kkrieger to debris. Procedural Content Generation Taken to Extremes NVScene 2008.
- and .kkrieger - Content creation in 96kb presented by Thomas Mahlke and Christoph Muetze at Assembly 2004.
- kkrunchy - A 64K executable compressor, see Fabian 'ryg' Giesen's presentations on compression, and more info on his blog post on how kkrunchy works. For more general background, I did a post a while ago on executable compression and various compression algorithms.
- V2 - A software synthesizer by Tammo "kb" Hinrichs, who used to have some great articles on his site describing how V2 worked. There are backups of his articles 'The Workings of fr-08's Sound System' here: Part 1: The Concept,Part 2: Why are SMF Files Smaller?, Part 3: The Basic System and Part 4: Let's Talk About Synthesizers. Related, is this article on 4klang a 4k synthesizer and an article I wrote on the basics of sound/instrument generation including wave generation (sin, square, etc.), ADSR envelopes, and modulation/filtering.
- ktg - Texture generator, not aware of much content on this from FR themselves, but thats probably because there are excellent articles on this by Ile / Aardbei 'Generating textures for 64k intros' (ATG is still my favourite texture generator), and the more in-depth 'Texture Generation For 64k Intros' by Nicholas Nash (Paradox / Vivid).
- genthree - Code for Candytron, with the beginnings of the half-edge mesh generator (see '20021211: neue meshes' in diary.txt) that is described in some recent blog posts by Fabian 'ryg' Giesen in Half edge theory and practice.
- lekktor - FR's failed dead-code removal tool, described in this blog post by Fabian 'ryg' Giesen.
Subscribe to:
Posts (Atom)





