Latest stories

What is Real-Time Operating System

In general, an operating system (OS) is responsible for managing the hardware resources of a computer and hosting applications that run on the computer. An RTOS performs these tasks, but is also specially designed to run applications with very precise timing and a high degree of reliability. This can be especially important in measurement and automation systems where downtime is costly or a...

What is Kalman Filter

Kalman filtering, also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those based on a single measurement alone. The filter is named after Rudolf E. Kálmán, one of the primary developers of its theory...

Inverse Kinematics using Fuzzy Logic

What Is Inverse Kinematics? Kinematics is the science of motion. In a two-joint robotic arm, given the angles of the joints, the kinematics equations give the location of the tip of the arm. Inverse kinematics refers to the reverse process. Given a desired location for the tip of the robotic arm, what should the angles of the joints be so as to locate the tip of the arm at the desired location...

Using a Simple Linked List as Queue in C

Simple data structures such as linked lists are almost always required in programming. The following code snippets provide the most basic functions for for using simple linked list as a queue in C programming language: Insert Item Remove Item (Please check also: Using a Simple Linked List as Stack in C) Insert Function (Example 1) struct node_t * insert_1(struct node_t * head, struct...

Using a Simple Linked List as Stack in C

The following code snippets are some useful functions for using a simple linked list as a stack in C programming language. (Please check also: Using a Simple Linked List as Queue in C) struct node_t * push_1(struct node_t * head, struct node_t * node) { node->next = head; return node; } // Example : 2 void push_2(struct node_t ** head, struct node_t * node) { node->next = *head; *head = node; }...

Reverse a Simple Linked List in C

Some more advanced functions for simple linked lists such as reserving could be a good reference. The following code snippet is a simple function for reversing a simple linked list. Please check also Using a Simple Linked List as Stack in C Using a Simple Linked List as Queue in C struct node_t * reverse(struct node_t * head) { struct node_t * temp = head; struct node_t * new_head =...

Inorder, Preorder and Postorder Traversal using C Programming

A major operation, which we often apply in a binary tree is the traverse. There are three different methods for traversing a tree: Preorder Inorder Postorder The following code snippets are these methods in C : void preorder_traversal(struct node_t * node) { if (node == NULL) return; printf("%dn", node->value); preorder_traversal(node->left); preorder_traversal(node->right); } void...

Simple and effective Semaphore for C++

A semaphore object is a synchronization object that maintains a count between zero and a specified maximum value. The count is decremented each time a thread completes a wait for the semaphore object and incremented each time a thread releases the semaphore. When the count reaches zero, no more threads can successfully wait for the semaphore object state to become signaled. The state of a...

CRC8 Simple Algorithm for C

The following code snippet is about CRC8 hash function. Usually in embedded systems there is an already built-in function for CRC8-16-32 etc. However in case there is not, here is a simple approach for it. CRCs are so called because the check (data verification) value is a redundancy (it expands the message without adding information) and the algorithm is based on cyclic codes. CRCs are popular...

A few words about Locomotion

A mobile robot needs locomotion mechanisms that enable is to move unbounded through-out its environment. However, there is a large variety of possible movement ways and so the selection of a robot’s approach to locomotion is an important aspect of mobile robot design. Most of the locomotion mechanisms have been inspired by their biological counterparts. Biological systems succeed in moving...

Disclaimer: The present content may not be used for training artificial intelligence or machine learning algorithms. All other uses, including search, entertainment, and commercial use, are permitted.

Categories

Tags