The basic idea of what I wanted to do was have the pixycam2 identify people in bright colors. Hiking backpacks are generally neon colored so that they can be easily identifiable at night. I'm going to use this fact to allow a drone to identify those neon colors and tell me where they are. That way, when a fire (or just a standard rescue mission) is going on and someone is hiking in that area, we can send a drone(s) across the forest and they will identify the neon backpacks and relay back the GPS coordinates back to the user.
The image below shows what I am trying to make. The drone has a defined path and as it passes each of the backpacks it will recognize the bright colors of the backpack and will log that file. Once the drone gets back from the route, all the gps coordinates will be logged and the search and rescue team can go and retrieve that individual.
The first part to do when you get the drone is to assemble it. Follow the guide that HoverGames provides - https://nxp.gitbook.io/hovergames/userguide/getting-started. It's pretty self explanatory. Make sure to watch all of the videos (multiple times in a couple places). Go slow and you will successfully assemble it. On mine, when I started it up for the first time, I burned through the radio transmitter and had to purchase a new one but that was the only item that seemed to die on me.
SoftwareI had initially tried to install and use all the software on my windows computer and then abandoned that and used their ubuntu file. That is the route to go with. It works significantly better and gets you up to speed much faster (always a good goal).
These were the settings I selected for the image:
You can skip some of the steps in the guide because most of the stuff is set up already which is very helpful.
Once the virtual ubuntu is setup you need to launch it and program the drone.
PixyCam2So I wanted to use the pixycam2 as the sensing device for this project. The first part of the testing is just to verify that I will be able to theoretically identify the neon backpacks. I decided that the easiest way to do this was to make a series of theoretical images of forests with neon colors. I made this out of construction paper because I don't have a forest nearby where I can test this.
Change the settings on the Interface of the PixyCam2 so that it can communicate using the I2C data port.
This is the results of testing it on my computer. I made a dummy forest just using construction paper. The goal was for the pixycam2 to identify the squares and give back the location of those squares. I will use that information to correlate it with where the drone physically located. This will allow firefighters to prioritize rescuing stranded hikers.
I went through the tutorial that they had for the PixyCam2 integration with the drone. I modified the code in order to print back the gps location whenever we detect a bright color.
// create global_pos_sub that grabs the vehicle_global_position
// I'm going to use it to transmit the location back
int global_pos_sub = orb_subscribe(ORB_ID(vehicle_global_position));
int pixycam_main(int argc, char *argv[])
{
// this is just for initialization
PX4_INFO("Hello pixycam driver");
usleep(5000);
Pixy2 pixy;
if (pixy.init() == 0) {
pixy.getVersion();
pixy.version->print();
usleep(1000);
while (1) {
int i;
// grab blocks!
pixy.ccc.getBlocks();
// If there are detect blocks, print them!
if (pixy.ccc.numBlocks) {
// I don't care about how many blocks there are but if any are
// detected then I want to print
// the location of those components
bool pos_updated;
// update the position using orb_check
orb_check(global_pos_sub, &pos_updated);
// print that we detected something at this position
// this will allow the drone to just
// have a set route, print off all
// of the positions and then we can
// individually review each one of
// these positions
printf("Detected at location: @u", global_pos_sub);
}
}
usleep(500);
}
}
What's LeftI still need to verify this in the field with actual backpacks but I think I will have to wait until the weather gets nicer where I am.
Comments