Skip to content

Team-NiMO/NiMo-FSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NiMo-FSM

A ROS-integrated finite state machine to facilitate the measurement of nitrate levels in cornstalks.

Overview

NiMo - Autonomous Nitrate Monitoring in Cornstalks

Nitrate based fertilizer is often over-applied to cornfields leading to detrimental environmental and health impacts. We are working to develop a system to monitor in-planta nitrate levels using a novel sensor from Iowa State University. More information can be found our website.

We have split this system into four subsystems:

More information about the communication between the FSM and these subsystems is shown in the figure below:

The overall flow of the FSM is motivated by the functional architecture shown below. The FSM is broken into six states:

  • Global - Check whether it is necessary to navigate to field or continue to next waypoint
    • global_nav_stat : True -> Global navigation in progress | False -> amiga already in field
  • Navigation - Navigate to next waypoint or delta step depending on cornstalk success
    • found_plan : True -> Plan has been found | False -> Plan has not been found
    • more_waypoints : True -> More waypoints exist | False -> All waypoints have been exhausted
  • Finding_Cornstalk - Detecting cornstalks in the area and selecting one to determine the optimal insertion side
  • Cleaning_Calibrating - Cleaning and calibrating the sensor to calibrate and check sensor functionality
  • Insertion - Grasping the cornstalk, inserting the sensor, and taking readings from nitrate sensor
  • Replace - Depending on the end-effector, moving to manually or automatically replace a broken sensor

Installation

Create a new ROS workspace and follow the installation instructions for all subsystems (Perception, Manipulation, External Mechanisms, End Effector). If desired, also source the workspace in ~/.bashrc.

mkdir ~/nimo_ws && mkdir ~/nimo_ws/src
echo "source ~/nimo_ws/devel/setup.bash" >> ~/.bashrc
...

Next, clone the repository into the src folder of your ROS workspace and make the workspace.

cd nimo_ws/src
git clone git@github.com:Team-NiMO/NiMo-FSM.git
cd ../ && catkin_make

Install ROS SMACH and terminator

sudo apt-get install ros-noetic-smach-ros
sudo apt-get install terminator

Move the terminator config to the terminator configuration folder. If you already have terminator configs, you will need to merge the nimo config with your existing config file.

cp docs/config ~/.config/terminator/

Finally, update the configuration file if necessary.

Use

There are two methods to launch the system:

  • Manually via multiple terminal commmands
  • Automatically via a terminator config
    • This method was chosen over a launch file so that the individual systems could be monitored separately

These methods will launch every node sequentially and display visualization tools mentioned in the next section.

Launching Manually

In separate terminals, run each of the following commands. If the workspace has not been sourced in the ~/.bashrc you will have to manually source it for each terminal.

roslaunch nimo_perception StalkDetect.launch
roslaunch nimo_manipulation nimo_manipulation.launch
roslaunch nimo_end_effector nimo_end_effector.launch
rosrun act_pump actp.py
rosrun NiMo-FSM FSM.py

Launching Automatically

From specifically terminal (not terminator) run the following commands.

pkill terminator
terminator -l nimo

Visualization

Launching the system also starts two visualization tools:

  • RViz - Displays the arm configuration, camera feed, and perception predictions
  • RQT_Multiplot - Displays the reading of the nitrate sensor in mV

More information about these is detailed in the Perception, Manipulation, and End Effector repositories.

Other

Swapping End Effector

For swapping end effectors, refer to swap.md.

Common Issues

General Errors

All errors should appear on the FSM terminal, if the error is not with the FSM itself, determine which subsystem is causing an error and refer to the errors in that terminal for more details.

Terminal doesn't load properly

If terminator is not killed properly, the windows may not load in the correct configuration. If this is the case, kill terminator and restart.

Serial Port Issues

Since both the external mechanisms and end effector use serial communication, if the communication is interrupted, the port may change. Launching the Arduino application and checking the ports can determine which device is linked to which port. More detailed instructions can be found in the respective repositories (External Mechanisms, End Effector).

Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published