vanderbiltrobotics / NASA-RMC-2018-2019

ROS Packages for NASA Robotic Mining Competition 2018-2019
MIT License
1 stars 6 forks source link

Create update node for sending reduced frequency updates to mission control #15

Open partlygloudy opened 5 years ago

partlygloudy commented 5 years ago

Which section of robot code is this for? General ROS communication

Description of feature There's lots of information we'll want to see from mission control regarding the status of the robot. The simplest way to do this is to just subscribe to lots of the topics where data is being published on the robot. However, these topics will have information published at very high rates and we are penalized for bandwidth usage. We should create a node that runs on the robot that subscribes to all the topics we want to see at mission control and publishes the information at a lower rate (maybe 1Hz or 2Hz).

Additional Notes This node should be fairly straightforward to right. Basically, there should be some class (UpdatePublisher) that has a variable ('latest message'), a subscriber, and a publisher. The constructor should take a topic name. The callback for the subscriber should update the 'latest message' variable. Finally, the class should have a 'publish' function that just publishes the 'latest message.' When the node is initialized, it should create one of these objects for every topic we want to send updates on. Then it should run a loop at the desired update rate. Every time through the loop, it should call the 'publish' function for each UpdatePublisher instance.

If the object subscribes to 'topic_name' it should publish to 'updates/topic_name'

Once the UpdatePublisher class is working, we should add the ability to read some type of configuration file that specifies which topics to subscribe to. So for instance a file could contain the lines:

current_pose Pose cmd_vel Twist

when the node is initialzed, it could then read the file, create an UpdatePublisher for each topic specified in the file and then enter the loop.