Skip to content

Instantly share code, notes, and snippets.

View Eddy-Morgan's full-sized avatar
🏠
Working from home

edward.ix Eddy-Morgan

🏠
Working from home
  • RKinDLab
  • USA
View GitHub Profile
spawn_entity = Node(
package='gazebo_ros',
executable='spawn_entity.py',
arguments=['-entity', 'bluerov2_heavy_alpha_urdf', '-topic', 'robot_description'],
output='screen'
)
nodes = [
ExecuteProcess(cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_init.so',
'-s', 'libgazebo_ros_factory.so'], output='screen'),
@Eddy-Morgan
Eddy-Morgan / sym_eigen.py
Last active March 3, 2024 06:57
symbolic expression for eigenvalues and eigenvectors of a system implemented in casadi
def qr_eigen(A, iterations=100):
pQ = SX.eye(A.size1())
X = copy.deepcopy(A)
for _ in range(iterations):
Q, R = qr(X) # QR decomposition in CasADi
pQ = pQ @ Q # Update eigenvector matrix for next iteration
X = R @ Q # Update eigenvalue matrix for next iteration
return diag(X), pQ
# example usage for a symbolic SX square matrix in casadi
#include <iostream>
#include <chrono>
#include "casadi/casadi.hpp"
using namespace std;
using namespace chrono;
using namespace casadi;
int main()
{
#include <iostream>
#include <chrono>
#include "casadi/casadi.hpp"
using namespace std;
using namespace chrono;
using namespace casadi;
int main()

I believe the article was originally written by fede.tft.

It appears they have copied source code to github and updated it for C++11: https://github.com/fedetft/serial-port

Introduction

The serial port protocol is one of the most long lived protocols currently in use. According to wikipedia, it has been standadized in 1969. First, a note: here we're talking about the RS232 serial protocol. This note is necessary because there are many other serial protocols, like SPI, I2C, CAN, and even USB and SATA.

Some time ago, when the Internet connections were done using a 56k modem, the serial port was the most common way of connecting a modem to a computer. Now that we have ADSL modems, the serial ports have disappeared from newer computers, but the protocol is still widely used.

In fact, most microcontrollers, even the newer ones have one or more peripherals capable of communicating using this protocol, and from the PC side, all operating system

@Eddy-Morgan
Eddy-Morgan / proxy.py
Last active December 19, 2023 04:37
Proxy integrated into selenium in scrapy middleware
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
import sys
import time
import logging
from scrapy import signals
from scrapy.mail import MailSender
from scrapy.utils.project import get_project_settings