Skip to content

Instantly share code, notes, and snippets.

View Sarath18's full-sized avatar
🙏
Namaste

Sarathkrishnan Ramesh Sarath18

🙏
Namaste
View GitHub Profile
@Sarath18
Sarath18 / PathPublisher.py
Last active November 4, 2023 22:48
Script to publish ROS2 data
#!/usr/bin/python3
import rclpy
from rclpy.node import Node
from geometry_msgs.msg import PoseStamped
from nav_msgs.msg import Path
from math import sin, cos, pi
from squaternion import Quaternion
class PathPublisher(Node):
@Sarath18
Sarath18 / video.py
Last active October 24, 2023 07:43
Publish images (sensor_msgs/msg/Image) from webcam or video on ROS2 topic(s)
#!/usr/bin/python3
import rclpy
from rclpy.node import Node
import cv2
import os
import sys
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImagePublisher(Node):
<?xml version="1.0"?>
<root main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<PipelineSequence name="NavigateWithReplanning">
<RateController hz="1.0">
<ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/>
</RateController>
<FollowPath path="{path}" controller_id="FollowPath"/>
</PipelineSequence>
</BehaviorTree>
@Sarath18
Sarath18 / waypoint_server.cpp
Last active October 27, 2019 11:19
Waypoint Server using BehaviorTree
#include <ros/ros.h>
#include <iostream>
#include <behaviortree_cpp/bt_factory.h>
#include <behaviortree_cpp/behavior_tree.h>
#include <nav_msgs/Odometry.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace BT;
std::pair<int,int> target (5, 5);