#!/usr/bin/env python
import ifroglab_jetson as ifroglab
import rospy
from std_msgs.msg import Int16MultiArray
from time import time
import os
import RPi.GPIO as gpio

os.system('sudo chmod a+rw /dev/ttyUSB0')
LoRa = ifroglab.LoRa()
rospy.init_node('lora_read_hand_pose')

gpio.setmode(gpio.BCM)
gpio.setup(22, gpio.IN)

ser = LoRa.FunLora_initByName("/dev/ttyUSB0")
LoRa.FunLora_0_GetChipID()
LoRa.FunLora_1_Init()
LoRa.FunLora_2_ReadSetup()
LoRa.FunLora_3_RX()
LoRa.debug = False
print("Lora ready!!")

hand_pose = []
pub_pose = Int16MultiArray()
while not rospy.is_shutdown():
    pin2 = gpio.input(22)
    #print("pin2 = ",pin2)
    if pin2 == 1:
        data = LoRa.FunLora_6_readPureData()
        #for i in data:
Пример #2
0
#!/usr/bin/env python
import rospy
#from std_msgs.msg import Int16MultiArray
from std_msgs.msg import String
#from funcase_client.msg import StringArray
import ifroglab_jetson
from time import time
import numpy as np

LoRa =  ifroglab_jetson.LoRa()
rospy.init_node('lora_lds_write')

# LoRa setup
ser=LoRa.FunLora_initByName("/dev/ttyUSB0")
LoRa.FunLora_0_GetChipID()
LoRa.FunLora_1_Init()
LoRa.FunLora_2_ReadSetup()
LoRa.FunLora_3_TX()
print("LoRa Ready!!!")

#coord_point = Int32MultiArray()
header = '*'

sep = ','

cnt = 0

def callback(data):
    tic = time()
    num = []
    num_list = []