vault backup: 2025-02-03 07:04:13

This commit is contained in:
2025-02-03 07:04:14 +01:00
parent e158386068
commit 7909836706
2019 changed files with 59 additions and 26816 deletions

View File

@@ -1 +0,0 @@
This article compares different actuators that are used in robotic systems.

View File

@@ -1,8 +0,0 @@
https://www.geeksforgeeks.org/a-search-algorithm/
# To Remember
1.
# To Study / Verify
1. Can we add wind to heuristic function --> it is easier to move with wind instead of against the wind

View File

@@ -1,24 +0,0 @@
---
title: Divide and Conquer
created_date: 2024-10-22
updated_date: 2024-10-22
aliases:
tags:
---
# Divide and Conquer
This is an algorithm design paradigm, where the main problem is split into sub problems, which then are split into further sub problems to be finally solved on a smaller level and if needed stitched back together to the overall solution. This recursive approach is often used in [[computer science]].
Mathematically, the algorithms are often proved to be true by [[mathematical induction]].
## Example Algorithms
- [[Sorting Algorithms]] such as quicksort or merge sort
- Multiplying large numbers: [[Karatsuba Algorithm]]
- Find the closest pair of points
- Computing the discrete Fourier Transform ([[Fast Fourier Transform |FFT]])
It can also be used in [[Computer Vision]] by first defining interesting [[Region of Interests |ROI]]s and only running the heavy algorithm on the subpart of the image.
## Advantages
- [[GPU]]s can be used to parallelize those subtasks and thus run the process much faster
- simplification: the problems become simpler to solve
- Algorithmic efficiency: reduce the [[big-O notation]]
- Memory Access: If the problem is small enough one can use only the computer [[cache]] to solve the subproblem, which makes it way faster

View File

@@ -1,12 +0,0 @@
---
aliases:
- ICP
---
[Iterative closest point](https://en.wikipedia.org/wiki/Iterative_closest_point) (ICP) is an algorithm to minimize the difference between two clouds of points, which means it can be used to reconstruct 2D or 3D surfaces from different scans. It is an algorithm that tries to solve the generic problem of [Point-Set registration](https://en.wikipedia.org/wiki/Point-set_registration)
# Implementations
- The library [libpointmatcher](https://github.com/norlab-ulaval/libpointmatcher?tab=readme-ov-file)
- The lightweight library [simpleICP](https://github.com/pglira/simpleICP)
-

View File

@@ -1,3 +0,0 @@
Mapping in robotics is the process of measuring and sensing the environment and using this information to populate a map. In the process the information is categorized (usually into obstacles and free space) into useful categories that are needed for the specific robotic application.
In order to start mapping we need to have information about where we are and thus [[Localization]] is required.

View File

@@ -1,6 +0,0 @@
It is a open-loop control system that tries to predict and counteract vibrations in a actuated system such as a 3D printer. The first couple of minutes of [this video](https://youtu.be/Fe_BFGg_ojg) explain a bit more.
# Use
## 3D Printers
This year, 3d printers have become 10 times faster while keeping the same print quality mostly because of input shaper technology. The guy in the video above uses a frequency test suite to test for resonance peaks. Next to the large peaks there are often small peaks that often correspond to screws that are slightly loose. In the image below you can see a pre / post tightening of all screws of the frame. The first of the doublepeak around 40Hz completely disappeared after the tightening.
![[Pasted image 20240312175212.png]]

View File

@@ -1,2 +0,0 @@
Path planning is the process of finding a path between a starting pose and a goal pose.
In order to plan a path we need a map, which is a representation of the environment. The map usually is dynamic and calculated by a process called [[Mapping]].

View File

@@ -1,31 +0,0 @@
Also known as managed Nodes in [[ROS2]]. The [[ROS2 - NAV2 Library|NAV2]] library makes good use of it.
From [ROS2 Design](https://design.ros2.org/articles/node_lifecycle.html):
>A managed life cycle for nodes allows greater control over the state of ROS system. It will allow roslaunch to ensure that all components have been instantiated correctly before it allows any component to begin executing its behaviour. It will also allow nodes to be restarted or replaced on-line.
>The most important concept of this document is that a managed node presents a known interface, executes according to a known life cycle state machine, and otherwise can be considered a black box. This allows freedom to the node developer on how they provide the managed life cycle functionality, while also ensuring that any tools created for managing nodes can work with any compliant node.
There are 4 primary states: *unconfigured, inactive, active, finalized*
There are 7 transitions: *create, configure, cleanup, activate, deactivate, shutdown and destroy*
## States
All nodes start with the **unconfigured** state, which is kind of like an empty state where everything starts but it might also end there
More important is the **inactive** state. its purpose is to breath life into a node. It allows the user to read parameters, add subscriptions and publications and (re)configure it such that it can fulfill its job. This is done while the node is not running. While a node is in this state it will not receive any data from other processes.
## Transition Callbacks
The main functions to implement for a custom node in the lifecycle scheme are:
### onConfigure()
Here the things are implemented that are executed only once in the Node's lifetime, such as obtaining permanent memory buffers and setting up topic publications/subscriptions that do not change.
### onCleanup()
This is the transition function that is called when a Node is being taken out of service (essentially the oposite of *onConfigure()*. Essentially it leaves the node without a state, such that there is no difference between a node that got cleaned up and another that was just created.
### onActivate()
This callback is responsible to implement any final preparations before the node is executing its main purpose. Examples are acquiring resources needed for execution such as access to hardware (it should return fast without a lengthy hardware startup).
### onDeactivate()
This callback should undo anything that *onActivate()* did.
## Management Interface
This is a common interface to allow a managing node to manage the different lifecycle nodes accordingly.
## Managing Node
This is the node that loads the different lifecycle nodes and is responsible to bring them from one state into the next and handle any error they feed back.

View File

@@ -1,83 +0,0 @@
The Pluginlib is a library for [[ROS2]] that allows a very modular development. It is heavily used in the [[ROS2 - NAV2 Library|NAV2]] Library.
From the [pluginlib tutorial]():
>`pluginlib` is a C++ library for loading and unloading plugins from within a ROS package. Plugins are dynamically loadable classes that are loaded from a runtime library (i.e. shared object, dynamically linked library). With pluginlib, you do not have to explicitly link your application against the library containing the classes instead `pluginlib` can open a library containing exported classes at any point without the application having any prior awareness of the library or the header file containing the class definition. Plugins are useful for extending/modifying application behavior without needing the application source code.
Basically it allows to define an abstract base class that defines the interface of the plugin. It defines what functions (`virtual`) need to be overwritten and what variables are there. You can then derive multiple packages with different implementations of this plugin base class which is used by an executor function. Those plugins can then be loaded at runtime without prior knowledge about them because they follow the same structure.
Requirements:
1. Constructor without parameters -> use initialization function instead.
2. Make header available to other classes
1. Add the following snippet to `CMakeLists.txt`:
```cmake
install(
DIRECTORY include/
DESTINATION include
)
...
ament_export_include_directories(
include
)
```
3. In the c++ file where you define your plugins you need to add the following macro at the very end. This creates the plugin instances when the corresponding library is loaded.
```cpp
#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(polygon_plugins::Square, polygon_base::RegularPolygon)
PLUGINLIB_EXPORT_CLASS(polygon_plugins::Triangle, polygon_base::RegularPolygon)
```
4. The plugin loader needs some information to find the library and to know what to reference in the libary. Thus an xml-file needs to be written as well as an export line in the package.xml file. With those 2 additions ROS knows everything it needs to know in order to use the plugins. In the following snippets we have the two Plugins: Square and Triangle defined in a plugin.xml file.
```xml
<library path="polygon_plugins">
<class type="polygon_plugins::Square" base_class_type="polygon_base::RegularPolygon">
<description>This is a square plugin.</description>
</class>
<class type="polygon_plugins::Triangle" base_class_type="polygon_base::RegularPolygon">
<description>This is a triangle plugin.</description>
</class>
</library>
```
```cmake
# polygon_base: package with base class
# plugins.xml: relative path to plugin file defined above
pluginlib_export_plugin_description_file(polygon_base plugins.xml)
```
How to use the plugins
The plugins can be used in any package that you want
```cpp
#include <pluginlib/class_loader.hpp>
#include <polygon_base/regular_polygon.hpp>
int main(int argc, char** argv)
{
// To avoid unused parameter warnings
(void) argc;
(void) argv;
pluginlib::ClassLoader<polygon_base::RegularPolygon> poly_loader("polygon_base", "polygon_base::RegularPolygon");
try
{
std::shared_ptr<polygon_base::RegularPolygon> triangle = poly_loader.createSharedInstance("polygon_plugins::Triangle");
triangle->initialize(10.0);
std::shared_ptr<polygon_base::RegularPolygon> square = poly_loader.createSharedInstance("polygon_plugins::Square");
square->initialize(10.0);
printf("Triangle area: %.2f\n", triangle->area());
printf("Square area: %.2f\n", square->area());
}
catch(pluginlib::PluginlibException& ex)
{
printf("The plugin failed to load for some reason. Error: %s\n", ex.what());
}
return 0;
}
```
>Important note: the `polygon_base` package in which this node is defined does NOT depend on the `polygon_plugins` class. The plugins will be loaded dynamically without any dependency needing to be declared. Furthermore, were instantiating the classes with hardcoded plugin names, but you can also do so dynamically with parameters, etc.

View File

@@ -1,6 +0,0 @@
- [ ] #todo/b Write overview of what ros2 does in my own words. Advantages / disadvantages
# Build System
The ROS2 [build system](https://docs.ros.org/en/humble/Concepts/Advanced/About-Build-System.html)is a challenging part, because packages written in different languages such as [[C++]] or [[Python]] need to be built together in order to form a unit.
To achieve this ROS2 relies heavily on the [[Colcon]] build system, which under the hood uses [[CMake]] for C++ packages and setuptools for Python. In order to define dependencies across the different packages and languages, ROS2 packages always contain a `package.xml` file also known as manifest file that contains essential metadata about the package, such as dependencies and others.