Monday, September 14, 2009

Quanser Visualization Blocks

In case anyone is keeping track, my main job at Quanser is working on electronics design, but I've been programming real-time computer graphics for years as a hobby. I suppose that hobby has now been elevated to profession as we prepare our new Visualization blocks for our next major release of QuaRC.

Our visualization blocks are made up of just two blocks, but they are both very powerful. You can get started right away by building a simple scene with the included graphical "primitives" - cubes, cylinders, cones, spheres, etc., which you can position and scale to schematically represent your simulation. Alternatively, you can use either the free modelling package Blender or Autodesk's commercial package 3ds Max (a 30 day trial is available here, Autodesk also offers a favorable academic pricing) with our included plugins to produce X3D mesh files that can be precise models of your system.

After you have your meshes loaded, you can wrap them with textures using one of many supported graphical formats. Next you can create relational hierarchies with selective inheritance of various properties. For instance you can create a robot arm and drive the position and orientation of every body in the system, or you can link them together to drive it by specifying the joint angles in either a relative or absolute coordinate system. The system has also been carefully designed so that each mesh and texture only needs to be loaded into memory once. This promotes very efficient memory usage so you can have a very large number of instances of objects in your system without also requiring a large amount of memory for every copy of the mesh or texture.


Another key feature provided by these visualization blocks is the ability to remotely connect to a visualization server with multiple clients. In one scenario, you might be running a real-time model on an unmanned aerial vehicle such as our new quadrotor UAV. Rather than trying to interpret what the 6 plot lines representing roll, pitch, yaw, and the x, y, z position translate to, you could add a visualization server to the UAV and stream the data to a visualization client. The server only sends the transformation information you need for your visualization, and none of the graphical information, so the impact on your model and communications bandwidth is minimal. The visualization blocks are also designed in such a way that they should never interfere with the operation of your real-time controller. In addition, the connection is persistent, so if your UAV goes out of radio range and then returns, the visualization will automatically reconnect.


The ability to connect with multiple clients to a common server opens up communication opportunities where a presenter could be demonstrating the operation of a model while multiple clients are watching, but with each client capable of wandering around the environment to look at it from different perspectives. You can even have multiple servers in a single diagram so you can have multiple representations of a common data set. One such interpretation might be different views from competing players in an air combat simulation, or more basic application might be one view to indicate your vehicle's current orientation, and a second view to indicate the position overlaid on a map.

The feature set is just about complete for QuaRC 2.0. We're currently working on lots of documentation and examples along with additional content files to get you up and running quickly. In the mean time, another hardware project is calling me...


- Derek -

No comments: