-
Alternative to enums in Typescript
Sometimes when adding types to an existing codebase it becomes difficult to use Enums when you want to type something that should have been an Enum. Consider the following component: const FilterComponent = ({ filterType }) => { if (filterType === "CHECKBOX") { return <div>Filtered by CHECKBOX</div>; } else if...
-
Webassembly to the rescue
While working on pointclouds for Amphion and Zethus, I came across an interesting problem. Consider the following scenario: a stream of messages containing an evolving pointcloud the messages contain certain fields like x, y, z, color, intensity compacted (arranged sequentially) into a blob the fields have their name, offset, datatype,...
-
Robotics in the browser! - Zethus + Amphion
The browser is perhaps the most versatile and approachable platform that has ever existed. Marrying it to robotics makes sense. For the last few months at work, I have been working in this direction with two open-source projects Zethus and Amphion. Amphion - A library that ingests ROS messages and...
-
Announcing three-freeform-controls
For the last few months I have been working (on/off) on a controls library for THREE.js objects. Finally got the time to finish the docs and api reference. It provides 6-dof rotation and translation controls and is built to be fully customisable (something that I found to be lacking in...
-
Typescript on steroids: Implementing Promisify
Typescript 2.8 introduced conditional types and the infer keyword. A conditional type performs a pattern match on a generic variable and based on the match it can assign a type value. We can use this pattern matching to extract the types of arguments supplied to a function. For a function...