Skip to content

Instantly share code, notes, and snippets.

View thehummingbird's full-sized avatar
🤠

Sharad Maheshwari thehummingbird

🤠
View GitHub Profile
void detectObjects()
{
std::shared_ptr<dai::ImgDetections> detectionsData;
cv::Mat frame;
updateImageData(frame); // function that updates frame with a static image
int sequenceNum = 0;
while (true)
{
@thehummingbird
thehummingbird / multiprocessing_example.py
Last active January 12, 2024 19:54
Multiprocessing Example Python
import time
import multiprocessing
import threading
LOOP_LENGTH = 100000000
def method1():
for _ in range(1, LOOP_LENGTH):
pass
@thehummingbird
thehummingbird / multithreading_example.py
Last active January 12, 2024 19:51
Multithreading Example Python
import time
import threading
LOOP_LENGTH = 100000000
def method1():
for _ in range(1, LOOP_LENGTH):
pass
@thehummingbird
thehummingbird / async_example.py
Last active January 12, 2024 19:39
Asynchronous Programming Example in Python
import asyncio
import time
async def counter():
print("One")
await asyncio.sleep(1)
print("Two")
@thehummingbird
thehummingbird / pytrees_3.py
Created October 30, 2023 22:49
Py Trees Example 3
from time import sleep
from py_trees.behaviour import Behaviour
from py_trees.common import Status
from py_trees.composites import Sequence
from py_trees import (
display as display_tree,
logging as log_tree
)
from py_trees.decorators import Inverter
@thehummingbird
thehummingbird / pytrees_2.py
Created October 30, 2023 22:47
Py Trees Example 2
from time import sleep
from py_trees.behaviour import Behaviour
from py_trees.common import Status
from py_trees.composites import Sequence
from py_trees import logging as log_tree
class Action(Behaviour):
def __init__(self, name, max_attempt_count=1):
super(Action, self).__init__(name)
@thehummingbird
thehummingbird / pytrees_1.py
Created October 25, 2023 21:12
Py Trees Example 1
from time import sleep
from py_trees.behaviour import Behaviour
from py_trees.common import Status
from py_trees.composites import Sequence
from py_trees import logging as log_tree
class Action(Behaviour):
def __init__(self, name):
super(Action, self).__init__(name)
@thehummingbird
thehummingbird / turtlebot3.repos
Created April 28, 2022 20:22
file for pulling turtlebot3 repos
repositories:
turtlebot3/turtlebot3:
type: git
url: https://github.com/ROBOTIS-GIT/turtlebot3.git
version: galactic-devel
turtlebot3/turtlebot3_msgs:
type: git
url: https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
version: galactic-devel
turtlebot3/turtlebot3_simulations:
@thehummingbird
thehummingbird / brain_node.py
Last active February 12, 2022 18:10
brain with params
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from custom_interfaces.srv import ComponentStatus
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import MultiThreadedExecutor
class BrainNode(Node):
@thehummingbird
thehummingbird / perception_node.py
Last active February 11, 2022 18:24
perception with params
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from custom_interfaces.srv import ComponentStatus
class PerceptionNode(Node):
def __init__(self):