Ejemplo n.º 1
0
import numpy as np
import os

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("rosnode_example")

#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))

#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter(
    "camera_topic",
    "/camera/rgb/image_raw/compressed"
)
camera_file = node.getFileInPackage(
    'roars',
    'data/camera_calibrations/asus_xtion.yml'
)
camera = CameraRGB(
    configuration_file=camera_file,
    rgb_topic=camera_topic,
    compressed_image="compressed" in camera_topic
)


#⬢⬢⬢⬢⬢➤ Camera Callback
def cameraCallback(frame):
    #⬢⬢⬢⬢⬢➤ Grabs image from Frame
    img = frame.rgb_image.copy()

    #⬢⬢⬢⬢⬢➤ Show
    cv2.imshow("output", img)
Ejemplo n.º 2
0
from roars.gui.widgets.WAxesEditor import WAxesEditor
from PyQt4 import QtCore
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtGui import QFileDialog
import PyQt4.QtGui as QtGui
import sys
import math
import os

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("roars_scene_explorer")
window_size = node.setupParameter("window_size", "1400;900", array_type=int)
scene_manifest_file = node.setupParameter("manifest", '')

WBaseWidget.DEFAULT_UI_WIDGETS_FOLDER = node.getFileInPackage(
    'roars', 'data/gui_forms/widgets')


class MainWindow(PyQtWindow):
    def __init__(self, uifile):
        super(MainWindow, self).__init__(uifile)

        # self.showMaximized()
        self.setFixedSize(window_size[0], window_size[1])
        #⬢⬢⬢⬢⬢➤ Scene Management
        self.scene_filename = ''
        self.scene = None
        self.frames = None

        #⬢⬢⬢⬢⬢➤ Frame Visualizers Management
        self.ui_scene_visualizers_list = [
Ejemplo n.º 3
0
#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))
debug = node.setupParameter("debug", True)

new_point_publisher = node.createPublisher("~new_point_event", Bool)
new_point_publisher_callback = node.createSubscriber(
    "~new_point_event", Bool, newPointCallback)


#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter(
    "camera_topic",
    "/usb_cam/image_raw/compressed"
)
camera_file = node.getFileInPackage(
    'roars',
    'data/camera_calibrations/microsoft_hd_focus2.yml'
)
camera = CameraRGB(
    configuration_file=camera_file,
    rgb_topic=camera_topic,
    compressed_image="compressed" in camera_topic
)

#⬢⬢⬢⬢⬢➤ ARP
arp_configuration = node.getFileInPackage(
    'roars',
    'data/arp_configurations/prototype_configuration.json'
)
arp = ARP(configuration_file=arp_configuration, camera_file=camera_file)

Ejemplo n.º 4
0
import os
import json

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("rosnode_example")

#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))

#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter(
    "camera_topic",
    "/camera/rgb/image_raw/compressed"
)
camera_file = node.getFileInPackage(
    'roars',
    'data/camera_calibrations/asus_xtion.yml'
)
camera = CameraRGB(
    configuration_file=camera_file,
    rgb_topic=camera_topic,
    compressed_image="compressed" in camera_topic
)

#⬢⬢⬢⬢⬢➤ ARP
arp_configuration = node.getFileInPackage(
    'roars',
    'data/arp_configurations/prototype_configuration.json'
)
arp = ARP(configuration_file=arp_configuration, camera_file=camera_file)

#⬢⬢⬢⬢⬢➤ Points storage
Ejemplo n.º 5
0
import roars.vision.cvutils as cvutils
import cv2
import numpy as np
import os
import json

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("rosnode_example")

#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))

#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter("camera_topic",
                                   "/camera/rgb/image_raw/compressed")
camera_file = node.getFileInPackage('roars',
                                    'data/camera_calibrations/asus_xtion.yml')
camera = CameraRGB(configuration_file=camera_file,
                   rgb_topic=camera_topic,
                   compressed_image="compressed" in camera_topic)

#⬢⬢⬢⬢⬢➤ ARP
arp_configuration = node.getFileInPackage(
    'roars', 'data/arp_configurations/prototype_configuration.json')
arp = ARP(configuration_file=arp_configuration, camera_file=camera_file)

#⬢⬢⬢⬢⬢➤ Points storage
points_per_object = node.setupParameter("points_per_object", 6)
collected_points = []
output_file = node.setupParameter("output_file", "/tmp/arp_objects.json")

Ejemplo n.º 6
0
import numpy as np
import os

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("rosnode_example")

#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))

#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter(
    "camera_topic",
    "/usb_cam/image_raw/compressed"
)
camera_file = node.getFileInPackage(
    'roars',
    'data/camera_calibrations/microsoft_hd.yml'
)
camera = CameraRGB(
    configuration_file=camera_file,
    rgb_topic=camera_topic,
    compressed_image="compressed" in camera_topic
)

#⬢⬢⬢⬢⬢➤ Creates marker detector
marker_detector = MarkerDetector(camera_file=camera_file, z_up=True)

markers_map = {}
for i in range(1, 1024):
    markers_map[i] = 0.04

Ejemplo n.º 7
0
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtGui import QFileDialog
import PyQt4.QtGui as QtGui
import sys
import math
import os


#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("roars_scene_explorer")
window_size = node.setupParameter("window_size", "1400;900", array_type=int)
scene_manifest_file = node.setupParameter("manifest", '')

WBaseWidget.DEFAULT_UI_WIDGETS_FOLDER = node.getFileInPackage(
    'roars', 'data/gui_forms/widgets'
)


class MainWindow(PyQtWindow):

    def __init__(self, uifile):
        super(MainWindow, self).__init__(uifile)

        # self.showMaximized()
        self.setFixedSize(window_size[0], window_size[1])
        #⬢⬢⬢⬢⬢➤ Scene Management
        self.scene_filename = ''
        self.scene = None
        self.frames = None
Ejemplo n.º 8
0
from roars.rosutils.rosnode import RosNode
from roars.vision.cameras import CameraRGB
import cv2
import numpy as np
import os

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("rosnode_example")

#⬢⬢⬢⬢⬢➤ Sets HZ from parameters
node.setHz(node.setupParameter("hz", 30))

#⬢⬢⬢⬢⬢➤ Creates Camera Proxy
camera_topic = node.setupParameter("camera_topic",
                                   "/camera/rgb/image_raw/compressed")
camera_file = node.getFileInPackage('roars',
                                    'data/camera_calibrations/asus_xtion.yml')
camera = CameraRGB(configuration_file=camera_file,
                   rgb_topic=camera_topic,
                   compressed_image="compressed" in camera_topic)


#⬢⬢⬢⬢⬢➤ Camera Callback
def cameraCallback(frame):
    #⬢⬢⬢⬢⬢➤ Grabs image from Frame
    img = frame.rgb_image.copy()

    #⬢⬢⬢⬢⬢➤ Show
    cv2.imshow("output", img)
    cv2.waitKey(1)