コード例 #1
0
ファイル: test3.py プロジェクト: zanellar/baxterpkg
#!/usr/bin/env python

import cv2
import argparse
import PyKDL

from superros.comm import RosNode
from baxterpkg.robot import BaxterRobot
from baxterpkg.cameras import BaxterCamera
from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion

# ROS node
node = RosNode("test")
node.setHz(node.setupParameter("hz", 1))

# camera
camera_right = BaxterCamera(node, limb=BaxterCamera.RIGHT)
camera_right.setting(resolution=(960, 600), exposure=100, gain=40)

# robot class
arm_right = BaxterRobot(node, limb=BaxterRobot.RIGHT)

Ftr_eef = PyKDL.Frame()
Ftr_eef.p = PyKDL.Vector(0.0, 0.0001, 0.0)

key = raw_input(".............. reset? [y]/n: ")
if str(key) not in ["n", "N", "no", "NO"]:
    arm_right.reset()

while node.isActive():
コード例 #2
0
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import rospkg
import numpy as np
import math
import json
from rocup.utils.tfmatrix import TfMatrixCube, TfMatrixHyperCube, TfMatrixSphere
from std_msgs.msg import Int32
from geometry_msgs.msg import Pose
import threading
from tf_matricies import getTfMatrix

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("matrix_tf_sequencer")
node.setupParameter("hz", 30)
node.setHz(node.getParameter("hz"))
node.setupParameter("scan", "default")
scan_name = node.getParameter("scan")
node.setupParameter("robot", "bonmetc60")
robot_name = node.getParameter("robot")

moving_pub = node.createPublisher("~moving_flag", Int32)
pose_pub = node.createPublisher("~tool_pose", Pose)

counter = 0
active_command = None

moving_flag = -1

number_of_frames = 0.0
done_frames = 0.0
コード例 #3
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import os
from PyQt4 import QtCore, QtGui, uic
from PyQt4.QtGui import *
import sys
from rocup.ui.uiproxy import UiProxy
from superros.comm import RosNode
import math

#⬢⬢⬢⬢⬢➤ NODE
node = RosNode("ui_slave_example")
node.setHz(2)

flag1 = True

# Receive Data From Ui


def eventCallback(evt):
    global flag1
    print("*** New Event Received ***")
    print(evt)

    if evt.name == "flag1":
        flag1 = evt.value > 0


ui_proxy = UiProxy()