The Arduino is used to continuously send messages to the Xbee serial port and receive them through another Xbee, which is monitored and verified by the Arduino serial port. The team understood Xbee's communication principles.
1. As required by our clients, the existing F110 platform has already connected a lot of sensor equipment, and the space on the body is not enough to support additional devices. So in the subsequent development, we chose the smaller XBee adaptor.
2. Because XBee adaptor only has the function of converting XBee UART serial port to USB serial port, so we must develop XBee library based on ROS development stack.
3. At the beginning we used XBee‘s Transparent communication mode, which has many limitations and is not flexible enough, so we put our focus on developing XBee API mode (which has more functions) library. This is also the main work after our prototype.
With the problems discovered and appeared in Prototype, we finally chose XBee USB Adaptor as the device for linking and converting XBee serial.
At the same time, this also means that we have abandoned many existing base and Arduino XBee libraries, and instead independently developed libraries suitable for the project.
Because in the early stage of development, we could not directly develop our communication module through the F110 platform. Since F110 is based on Jetson Board running Ubuntu system, the system is mainly written by ROS-kinetic (Robot Operating System). We installed the Ubuntu version virtual machine Ubuntu 16.04 LTS supported by ROS-kinetic on our computer.
At the end of the semester we successfully tested the possibility of developing XBee API library based on ROS development stack. The most important of these is serial communication.
Ubuntu is an unfamiliar operating system for us, and ROS is also very novel for us. We spent some time learning their operation and logic.
At the end of the semester we successfully tested the possibility of developing XBee API library based on ROS development stack. The most important of these is serial communication. So at the beginning of the new semester we invested in learning them.
After spending some time researching ROS, we gradually mastered its working mechanism.
We wrote a node for message sending and receiving based on XBee's Transparent mode using ROS. The test was very successful, any data input to the serial port was successfully sent and received. But new troubles were born...🤔
1. When using Transparent mode for unicast or broadcast communication, we need to use command mode and AT command to control the destination address. In the command mode, each AT command needs a response time, which causes communication efficiency concerns.
2. Because the Transparent mode is very direct, the data written to the serial port is the last data actually received, so it is very difficult to distinguish the two data. Plus, if you receive data from two devices at the same time, it will be almost impossible to distinguish them. This cause a communication conflict.
3. Transparent mode communication is relatively unreliable. If you write long data to the serial port in an instant, it may cause high delay or even data loss.
Finally we decided to develop a communication API based on the XBee API mode. XBee API mode uses fixed format frames which contain information of devices to send and receive data. This solves the problem that the above data is difficult to distinguish. At the same time, the API mode is also very reliable. Due to the existence of checkout, the data will not be lost or damaged.
After a month of research, we finally completed the basic library of this project, XBee API mode library.
It has complete basic functions and can package some useful XBee API frames, such as AT Command and Transmit request (which allow us to send messages to specific addresses ). At the same time, it can also read and identify the received XBee API frames. On this basis, our project progress has significantly accelerated.🚀
After completing the XBee API library, our focus shifted to the development of ROS nodes.
We used the XBee API library to write an xbee_api ROS package. In this package, there is an xbee_api_node.py node written by Python. It has a complete communication function and at the same time can encapsulate commonly used AT command API frames.
We demonstrated the functionality of this node to our clients. They made several requests and suggestions to us.
Our clients made 3 requests to us.
1. Write a server that automatically discovers XBee nodes in the network and saves their addresses and node identifier parameters.
2. Customize a ROS msg so that the node identifier of the target XBee can be determined when initializing this ROS msg.
3. Automatically serialize and deserialize data in nodes (XBee can only transfer byte or string data).
Our project is nearing completion!🎉
We have finally completed the entire content of the project, above is our Demo video.
Thank you for you watching, you can return to home page now.
Please Email us if there are any problem.