ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
At CWRU, we also use NI CompactRIOs for low-level control and standard x86 PCs for higher-level processing. The x86 computers run Ubuntu and ROS and are networked to the NI cRIOs.
What we did to facilitate communication between components was to write a simple UDP protocol for the interaction between the cRIO and ROS PC instead of attempting to implement a ROSTCP client on the cRIO side. In this case, all we needed to do is write a listener program on the ROS PC that translated our protocol into ROS messages - and since it's on the x86 PC, we were able to use the existing roscpp and rospy libraries.
For host PC side examples, check out crio_receiver.cpp (latest, but most complex listener node) and pose_broadcaster.py (older, but simpler Python node). These nodes listen to UDP packets from the robot's cRIO and extract information to fill a nav_msgs/Odometry with.
For the cRIO side, you should be able to find some examples of packing and sending UDP (or TCP if you prefer) packets from LabView. We actually used C on the cRIO using the GNU toolchain available on NI's website, but, due to the unknown state of the copyright on some of the files, our cRIO code is not open-source and cannot be redistributed.
Hope that helps. I'd be happy to elaborate more on any of this if you have specific questions.
2 | Adding in the sender. |
At CWRU, we also use NI CompactRIOs for low-level control and standard x86 PCs for higher-level processing. The x86 computers run Ubuntu and ROS and are networked to the NI cRIOs.
What we did to facilitate communication between components was to write a simple UDP protocol for the interaction between the cRIO and ROS PC instead of attempting to implement a ROSTCP client on the cRIO side. In this case, all we needed to do is write a listener program on the ROS PC that translated our protocol into ROS messages - and since it's on the x86 PC, we were able to use the existing roscpp and rospy libraries.
For host PC side examples, check out crio_receiver.cpp (latest, but most complex listener node) and pose_broadcaster.py (older, but simpler Python node). These nodes listen to UDP packets from the robot's cRIO and extract information to fill a nav_msgs/Odometry with.with.
There is also the twist_receiver.py that takes Twist messages and outputs UDP commands containing speed and spin rate to the cRIO.
For the cRIO side, you should be able to find some examples of packing and sending UDP (or TCP if you prefer) packets from LabView. We actually used C on the cRIO using the GNU toolchain available on NI's website, but, due to the unknown state of the copyright on some of the files, our cRIO code is not open-source and cannot be redistributed.
Hope that helps. I'd be happy to elaborate more on any of this if you have specific questions.