|
| 1 | +--- |
| 2 | +title: Unispectral Monarch Pro |
| 3 | +sidebar_label: Unispectral Monarch Pro |
| 4 | +keywords: |
| 5 | + - unispectral |
| 6 | + - monarch |
| 7 | + - multispectral |
| 8 | + - camera |
| 9 | + - integration |
| 10 | + - leo |
| 11 | + - example |
| 12 | +description: >- |
| 13 | + Learn how to connect a Monarch Pro multispectral camera to your Leo Rover for |
| 14 | + multispectral imaging. |
| 15 | +
|
| 16 | +image: /img/robots/leo/integrations/monarch-pro/monarch-pro.webp |
| 17 | +--- |
| 18 | + |
| 19 | +This tutorial will guide you through the process of connecting a Monarch Pro |
| 20 | +camera to your Leo Rover. |
| 21 | + |
| 22 | +The [Monarch Pro](https://unispectral.com/monarch-pro/) is the ultimate camera |
| 23 | +for advanced imaging, offering detailed material analysis through hyperspectral |
| 24 | +imaging capabilities. It combines high-resolution spectral data capture with |
| 25 | +real-time processing to provide comprehensive insights beyond the visible |
| 26 | +spectrum. It can be used for material identification, crop health monitoring, |
| 27 | +and industrial inspection. With its ability to capture and analyze a wide range |
| 28 | +of wavelengths, the Monarch Pro enables precise analysis and decision-making |
| 29 | +across multiple industries. |
| 30 | + |
| 31 | +<ImageZoom |
| 32 | + src="/img/robots/leo/integrations/monarch-pro/monarch-pro.webp" |
| 33 | + width="1200" |
| 34 | + height="668" |
| 35 | + figStyle={{ |
| 36 | + width: 600, |
| 37 | + }} |
| 38 | +/> |
| 39 | + |
| 40 | +## What to expect? |
| 41 | + |
| 42 | +After completing this tutorial, you will have successfully connected a Monarch |
| 43 | +Pro stereo camera to the Leo Rover in ROS, and you will possess basic knowledge |
| 44 | +about the use of the multispectral camera. |
| 45 | + |
| 46 | +## Prerequisites |
| 47 | + |
| 48 | +<LinkButton docId="leo-rover/guides/ssh" /> |
| 49 | +<LinkButton docId="leo-rover/guides/connect-to-network" /> |
| 50 | +<LinkButton docId="leo-rover/advanced-guides/install-ros-on-your-computer" /> |
| 51 | + |
| 52 | +## List of components |
| 53 | + |
| 54 | +- Monarch Pro Multispectral Camera |
| 55 | +- Any mounting solution |
| 56 | +- USB-A to USB-C cable |
| 57 | + |
| 58 | +## Software integration |
| 59 | + |
| 60 | +We have prepared special ROS wrapper for the unispectral's Monarch Pro camera. |
| 61 | + |
| 62 | +### Installing the packages |
| 63 | + |
| 64 | +:::note |
| 65 | + |
| 66 | +We are going to install the software on the rover, as the wrapper to work |
| 67 | +properly needs the cable connection with the camera. Therefore start with |
| 68 | +getting onto the rover with `ssh`. If you don't know how to do it, please follow |
| 69 | +this guide first: |
| 70 | + |
| 71 | +<LinkButton docId="leo-rover/guides/ssh" /> |
| 72 | + |
| 73 | +Also for the installation you need to have local ROS workspace on the rover. If |
| 74 | +you don't have one, follow the **Building additional ROS packages** part of |
| 75 | +**ROS Development** tutorial: |
| 76 | + |
| 77 | +<LinkButton docId="leo-rover/advanced-guides/ros-development" /> |
| 78 | + |
| 79 | +::: |
| 80 | + |
| 81 | +First you have to download it into `src` directory of your ROS workspace: |
| 82 | + |
| 83 | +```bash |
| 84 | +cd <path_to_your_ros_workspace>/src |
| 85 | +git clone https://github.com/fictionlab/ros_monarch_pro.git |
| 86 | +``` |
| 87 | + |
| 88 | +Having the source code, we need to install all of the required dependencies so |
| 89 | +the package can be built successfully. To install the dependencies, type: |
| 90 | + |
| 91 | +```bash |
| 92 | +sudo apt update |
| 93 | +rosdep update |
| 94 | +rosdep install --from-paths src -iry |
| 95 | +``` |
| 96 | + |
| 97 | +:::note |
| 98 | + |
| 99 | +If this is your first package in the ROS workspace, or you haven't built it yet |
| 100 | +you need to source `/opt/ros/<your distro>/setup.bash` |
| 101 | + |
| 102 | +::: |
| 103 | + |
| 104 | +Now to install the package, you just have to type: |
| 105 | + |
| 106 | +```bash |
| 107 | +catkin build |
| 108 | +``` |
| 109 | + |
| 110 | +If the building process was successful, you are ready to run the wrapper. |
| 111 | + |
| 112 | +## Examples |
| 113 | + |
| 114 | +### Running the node |
| 115 | + |
| 116 | +Running the installed software is really easy as we have prepared launch file |
| 117 | +for it. To run it, enter your ROS workspace and type: |
| 118 | + |
| 119 | +```bash |
| 120 | +source devel/setup.bash |
| 121 | +roslaunch monarch_ros wrapper.launch |
| 122 | +``` |
| 123 | + |
| 124 | +The node provides a ROS service, which saves a spectral cube into images to |
| 125 | +specified directory. To trigger the image save you need to run in other terminal |
| 126 | +(with your ROS workspace sourced): |
| 127 | + |
| 128 | +```bash |
| 129 | +rosservice call /monarch_pro_wrapper/save_images |
| 130 | +``` |
| 131 | + |
| 132 | +If the save was successful you will receive the path to parent directory, where |
| 133 | +the data is stored. Each call to the service results in creation of a separate |
| 134 | +directory named like `cube_<date>` inside the parent directory, which contains |
| 135 | +the saved files. By default the parent directory is set to your home directory. |
| 136 | +To change it you can either change the argument inside the `wrapper.launch` |
| 137 | +file, or you can set its value during launching the program - for example: |
| 138 | + |
| 139 | +```bash |
| 140 | +roslaunch monarch_ros wrapper.launch data_path:="/<your>/<desired>/<path>" |
| 141 | +``` |
| 142 | + |
| 143 | +### Configuring the node |
| 144 | + |
| 145 | +In the downloaded repository, there is a config file with camera parameters. The |
| 146 | +parameters are loaded to the node automatically during the launch process. You |
| 147 | +can change the provided camera parameters to your desired values (available |
| 148 | +settings are `gain` and `exposure fps`). To load them into the program and your |
| 149 | +camera, you need to restart the node. |
| 150 | + |
| 151 | +If you have ROS installed on your computer, you can also change the camera |
| 152 | +wrapper parameters in runtime using the rqt dynamic reconfigure plugin. |
| 153 | + |
| 154 | +Before starting any of the programs, make sure you completed the **Connecting |
| 155 | +another computer to ROS network** of **ROS Development** tutorial: |
| 156 | + |
| 157 | +<LinkButton docId="leo-rover/advanced-guides/ros-development" /> |
| 158 | + |
| 159 | +Now you can start `rqt`, and from `plugins` -> `configuration` choose |
| 160 | +`dynamic reconfigure` and then choose the `monarch_pro_wrapper` node. On the |
| 161 | +right side of the screen you will see the mentioned parameters - you can use the |
| 162 | +sliders and boxes next to them to change the values of the parameters. |
| 163 | + |
| 164 | +## What next? |
| 165 | + |
| 166 | +You can check our [Integrations page](/leo-rover/integrations) for more |
| 167 | +instructions. |
0 commit comments