ROS2 Field Nodes
===
###### tags: `ROS2` `OFFSET`
[TOC]
## Getting Started
```
docker-compose up
docker start field_node
docker exec -it field_node bash
. ./node run <executable>
```
:closed_book: Tasks
--
==Importance== (1 - 5) / Name
### Development/Design (ROS2):
- [ ] ==5== Single executable to launch docker container and ros2 node (protoype)
- [x] Start Docker 'field_node' container
- [x] Start source ros2/install files
- [x] Export ROS_DOMAIN_ID (Default=50) #Just a random number
- [x] Enter docker interactive mode
- [ ] Auto launch script on rpi boot up
- [ ] Configuration file (YAML/JSON) for setting env variables (future: addition)
- ROS_DOMAIN_ID: 50
- DDS: rmw_fastrtps_cpp
- Default package: field_node
- [ ] ==5== Eg. Cyclone DDS Implementation
- [ ] ==3== Heartbeat
- [x]==5== **Hostname**
- [x]==5== **CPU Temp** (Not sure how we want to layout individual cores)
- [x]==5== **Memory usage**: (type float)
- [x]==5== **Git Hash**: (type str) first 4 characters
- [x]==5== **Git status**: (Type bool) Any change made to the repo
- [ ]==5== **RPI image version**: Figure out some type of version control
- Docker version control?
- [x]==1== **timestamp**: internal use only (mole will add its own timestamp)
- [ ] **Currenty running module?**: (type list)
- [ ] **total ros nodes?** (type int)
- [ ] **connected hardware?** (type list)
- [ ] ==3== ros2 Logging (ros2bag, python logging lib)
- FX3: Python logging used for debugging and to see past events
- [ ] ==3== ros2 launch (optional)
- Are we talking this approach to launch on boot up?
- ros2 launch provides spinning multiple nodes in seperate processes. This could be useful if we wanted to spin a seperate node that does not have any ties with the field_node_manager. This could potentially be the field_node_manager and heartbeat node. Also, it provides a much cleaner way of attaching YAML files to nodes.
- [x]==5== Dynamically change RPI hostname
- Confirm hostname in docker container is updated
- [ ] ==5== Dynamically change IP address
- Confrim IP address is reflected in the docker container
- [ ] ROS Launch for YAML files (Anthony)
- [ ] Debugging
- [ ] ROS Bag
### Development/Design (System):
- [x] ==5== Set default hostname after bootup
- Use first 4 digits of eth0 or acquire cpu id number
- open for other suggestions
- [ ] ==5== Connect to DNS Server (PiHole)
- Use default hostname if server is unavailable
- Confirm with daniel if this is still the direction to take
- [ ] ==5== Image Version control
- [ ] ==5== RUN ROS2 field_node after hostname check and boot
- [ ] ==5== setup NTP client
- [ ] ==3== Disable Wifi/Bluetooth on boot
- [ ] ==5== Jacob: Confirm ble code can re-enable bluetooth
- [ ] ==5== Enable SSH
### Testing:
- [ ] Use two systems running the mock_field_manager setup
- [ ] Use a system running mock_mole
- [ ] What happens to /parameters_event?
- [ ] Do you receive both parameter updates from multiple nodes
### Issue/Concern:
- ~~How to get git hash in interactive mode?~~
- If hostname changes, the topic will also change unless we assigned a unique topic name that doesn't rely on hostname.
- How to recieve module level params. i.e. set detonation duration of an ied
- Where does the param reside?
- Field_node_manager?
- Field_node_module_ied?
- Will mole publish param along with initial configuration?
- {module: ied, param_ied_det_time: 5}
- Will this be a two step configuration?
- OFFSET: Currently is a single step configuration, which includes robot agent registration
- Optional Solution:
- All module level params reside in the field_node_manager. This includes params for gate, fog, ied, dynamic_tag, etc.
- Dynamically change Hostname/IP Address.
- Changes should be reflective in the docker container
- How fast can a ros callback method execute if the triggering mech for that callback is triggering at a high rate?
- https://robotics.stackexchange.com/questions/20069/are-rospy-subscriber-callbacks-executed-sequentially-for-a-single-topic
- https://answers.ros.org/question/315920/how-to-add-queue-size-in-rclpycreate_publisher/
## Notes
Download pyserial for python.
I like this. Will force me to learn MD better hahah
haha we can put this on the README too
## Triggerman FSM Module
- Proximity Agent In/Out can occur in any artifact state.
ROS2 Node Checklist
===
## Module
- Triggerman
- IED
- Entrypoint
- Benign
- Counter UXS
- Verified Hostile
- Hostile
- Priority Intel
- Intel
- Non-combatant
- DynamicTag
-
## Components
- RPI_Bluetooth
- BLED112
- [ ] Parameter Values
- [ ] Topics
- [ ] Documentation
- [ ] Configurable
- Multiple modules can use this. Saam bot and artifacts.
-