This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reading from a MCAP file | |
# sudo apt install ros-$ROS_DISTRO-ros-base ros-$ROS_DISTRO-ros2bag ros-$ROS_DISTRO-rosbag2-transport ros-$ROS_DISTRO-rosbag2-storage-mcap | |
from mcap import __version__ | |
print(__version__) | |
"""script that reads ROS2 messages from an MCAP bag using the rosbag2_py API.""" | |
import argparse | |
from rclpy.serialization import deserialize_message | |
from rosidl_runtime_py.utilities import get_message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <visualization_msgs/Marker.h> | |
#include <math.h> | |
///.... | |
ros::Publisher circ_marker_pub = n.advertise<visualization_msgs::Marker>("pure_circle", 1); | |
///.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import struct | |
import numpy as np | |
import rospy | |
from std_msgs.msg import Header | |
from sensor_msgs.msg import Image, CompressedImage, CameraInfo, PointCloud2, PointField | |
from image_geometry import PinholeCameraModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## PYTHON2 | |
# subscribes to PointCloud2, transforms to "map" and saves as npy | |
import rospy | |
from sensor_msgs.msg import PointCloud2 | |
import sensor_msgs.point_cloud2 as pc2 | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import time | |
import sys | |
import numpy as np | |
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') | |
import cv2 | |
import cv2.aruco as aruco | |
import numpy as np | |
import rectangleArea as ra |