lps node transmits data to PC by usb
Posted: Sat Dec 12, 2020 3:38 am
Hi!
I want to implement lps node as anchor and tag at the same time, but now I have some problems:
1. I have realized the communication between two crazyflies (crazyflie serves as anchor and node at the same time)
2. According to the logic in 1, I hope to realize the lps node as anchor and tag at the same time, but I have encountered some problems:
First, crazyflie initiates ranging and sends poll packet, lpsnode receives poll packet and returns an answer packet. The problem is:in the rxcallback() function on the crazyflie side, rxpacket.payload[0] = (unsigned int) 48, does not belong to [0x01,0x02,0x03,0x04], so it cannot enter the switch( ) .
here is the code in lpsnode,which is try to set the node as anchor and tag at the same time:https://paste.ubuntu.com/p/mC7D3ZQ7v2/
here is the code in crazyflie,which is try to deal with the packets from lpsnode(as anchor & tag):https://paste.ubuntu.com/p/zQJq2hBPhd/
So, I want to see if payload[0] is written to the lps node and to output some parameters on the lps node through the USB serial port.
I want to know if this can be achieved? Which part of the code is involved? Is it possible to modify the stm32 code directly?
I want to implement lps node as anchor and tag at the same time, but now I have some problems:
1. I have realized the communication between two crazyflies (crazyflie serves as anchor and node at the same time)
2. According to the logic in 1, I hope to realize the lps node as anchor and tag at the same time, but I have encountered some problems:
First, crazyflie initiates ranging and sends poll packet, lpsnode receives poll packet and returns an answer packet. The problem is:in the rxcallback() function on the crazyflie side, rxpacket.payload[0] = (unsigned int) 48, does not belong to [0x01,0x02,0x03,0x04], so it cannot enter the switch( ) .
here is the code in lpsnode,which is try to set the node as anchor and tag at the same time:https://paste.ubuntu.com/p/mC7D3ZQ7v2/
here is the code in crazyflie,which is try to deal with the packets from lpsnode(as anchor & tag):https://paste.ubuntu.com/p/zQJq2hBPhd/
So, I want to see if payload[0] is written to the lps node and to output some parameters on the lps node through the USB serial port.
I want to know if this can be achieved? Which part of the code is involved? Is it possible to modify the stm32 code directly?