Skip to content

Instantly share code, notes, and snippets.

View ottocol's full-sized avatar

Otto Colomina ottocol

  • http://www.ua.es
View GitHub Profile
@ottocol
ottocol / modelo_sensor.py
Created October 1, 2025 08:26
modelo del sensor basado en haz de luz y likelihood field, tema 2.3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Beam range sensor — Beam Model + Likelihood Field Model (LFM)
- First: show the simulated occupancy map and raycasting result (z_exp).
- Second: plot the BEAM model mixture components and total (continuous + stem at z_max).
- Third: implement and plot the Likelihood Field Model curve p(z | x, m) for the same beam.
(Also display the distance field heatmap for intuition).
@ottocol
ottocol / motion_models_odometry.py
Created October 1, 2025 07:55
modelos de movimiento del tema 2.2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Odometry-based motion model (Probabilistic Robotics style)
Implements:
- motion_model_odometry(xp, x, u, alphas) -> likelihood p(x' | u, x)
- sample_motion_model_odometry(u, x, alphas, n) -> samples x' ~ p(x'|u,x)
- odom_from_poses(xp, x) -> (Δrot1, Δtrans, Δrot2) from two poses
from scipy.stats import norm
import math
#desviación típica del sensor
EPSILON_ALFA = math.radians(15)
EPSILON_D = 0.3
# calcula el valor de una gaussiana en un punto x, sup. media 0 y desv típica epsilon
def prob(x, epsilon):
return norm.pdf(x, loc=0, scale=epsilon)
<html>
<head>
</head>
<body>
<script type="module">
//Nos autentificamos y probamos a obtener la lista de la compra
//solo para ver qué pasa con los tokens jwt desde las herramientas de desarrollador
import PocketBase from "https://unpkg.com/pocketbase/dist/pocketbase.es.mjs";
@ottocol
ottocol / Dockerfile
Last active July 26, 2024 17:25
dockerfile para ubuntu 18.04 + ROS Melodic + Turtlebot 2 + Turtlebot 3 + NoVNC
FROM dorowu/ubuntu-desktop-lxde-vnc:bionic
ENV DEBIAN_FRONTEND noninteractive
# Setup your sources list and keys
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
#!/usr/bin/env python
import string
from random import random, shuffle
import os
# import pygraphviz as pgv
from time import sleep
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import Twist
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from pi_trees_ros.pi_trees_ros import *
class Patrol_tree:
def __init__(self):
rospy.init_node("patrol_tree")
@ottocol
ottocol / index.html
Created November 27, 2017 12:13
JS Bin Chistes de Chuck Norris con RxJS // source http://jsbin.com/waselup
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Chistes de Chuck Norris con RxJS">
<meta charset="utf-8">
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>