-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Communication between Edison and Flip 1.5 Not Working #24
Comments
WIKI : https://github.com/bhunt2/QC1.0/wiki/Flight-Automation-Overview Tests: https://github.com/bhunt2/QC1.0/wiki/Flight-Automation-Overview#tests . There are lots of commands but I only want to test couple for now. Those commands have already been documented here http://www.multiwii.com/wiki/index.php?title=Multiwii_Serial_Protocol in details. My Code : https://github.com/bhunt2/QC1.0/blob/master/Sabin-Code/sendCmdConverted.cpp |
Output 1 (with ground wire connected):https://github.com/bhunt2/QC1.0/blob/master/Sabin-Code/Capture_with_ground.PNG Output 2 (without ground wire connected):https://github.com/bhunt2/QC1.0/blob/master/Sabin-Code/Capture_without_ground.PNG I do not see any headers "$M<" with ground wire connected. There are no "frame" or patterns. It looks like bunch of garbage data. For ground wire not connected, I just get back what I send. Also, When Flight controller has no power (no power to drone), when I sent the commands, I get the same outputs back like I stated above. UART info: UART @ dev/ttyMFD1. 115200 baudrate . |
Sabin, this output is looking better than what I was seeing before. Please add a print out of the command being sent such as: "Sending 100" or something like that so it is understand what the response is for. In the two images you posted above, the second one is with ground unattached/the power is off on the Flip. The first image is with the ground attached and what seems like some kind of response from the Flip, but it is unclear if it means anything. If I read your code correctly, you are only sending one command that is hard-coded into the code and then running an infinite while loop while you wait for a response. If you are only sending one command that has a specific return size and type, why does it seem like you are getting back way more than you should be? Again, I don't know which command/request this picture is issuing to get this response so it is difficult for me to determine anything from this. From the looks of it, the first several bytes that come through are an appropriate response. We just don't know what the rest is. Also, please load the data received into a struct that stores the data in its appropriate frame. This will facilitate much faster debugging and clear outputs. Do you have everything connected so that I would be able to run your code myself and see what is happening? |
Yea, you can run my code . it is under @root Drone/drone.cpp (this is my old code). |
I thought you had these connected and powered via USB right now while are figuring this stuff out. Especially while the drone cannot be flown, there is no reason why the two boards can't be connected by wall power or something else that doesn't need to be charged. Right now we need as much access to the Edison, Flip, and camera as possible to accomplish the current tasks. |
Also, thanks for the update on where your code is and that it is ok for me to run it. Please answer the other questions I had in regards to what we are seeing and update the documentation to show the new outputs. We can figure this out quick if we work together on it. |
I think I figured out why you have to use the drone to power, it is because the USB is not repaired yet. Correct? |
Yes, I was trying to connect the Flip with USB adapter and that's when it broke. Hau will pick it up Monday and fix it soon as possible because my tasks depends on Flip. |
What is the plan for getting the system back online for us to begin working on this again? I know that a few things need to be fixed, but hopefully in a day or two right? |
Yes, I'm hoping Hau gets it fixed quickly so that I can work on it. |
|
Oh! I thought you meant just copy your comment over. I'll re post all threads here from #27 |
|
|
These are the following things I found:
|
I've recorded an attitude output. It is running on python code. |
That looks good. Is this the code that you found in Python and just decided to try it out as is? I only see the Flip1.5 in the video, but it is connected to the Edison sitting on your desk or something right? Please post information about what you did and how it worked and add the code to the repository. Also, updated Taiga appropriately. Then, please provide your plans for moving forward with this issue as we still need to test all commands and decide how to integrate with everything else. Are you going to stick with this Python code or will you be converting it to C++? |
@bhunt2 @spesialstyrker @Kekahuna Yes, I used the python code that I found before (https://github.com/alduxvm/pyMultiWii). The C++ code that I have wrote is about the same except I used mraa library while python just using pyserial library. On python code, struct.pack and struct.unpack for packet conversions. kainoa's image processing is on c++. That's why I went with c++. Python is much easier to use with their awesome libraries and if I use python, I might have to tell kai to write his code on python or use some other method to communicate with kainoa's c++ code. I will update the plans on my wiki but here is brief:
|
@sabmah @Kekahuna @hautruong36 @spesialstyrker I think that it is totally unreasonable to have Kainoa switch his code just to make your task easier. It would take far more time for him to port all of his work to Python than it would for you to debug your code. Also, communicating between programs would take processing power that you don't want to waste so that really isn't an option. It is possible to write C/C++ wrappers to extend Python code but I don't think that is a good option here either especially because you don't have much experience with either. I would like to try and help but with the current circumstances it is difficult because I don't know when the Edison is connected to the Flip. If you guys can work out a schedule to know when things are going to be connected then we can try things out. If you need help with anything specific that would be easier to have someone beside you, I am sure Michael would be happy to work through it with you. In regards to your plans to write Arm and Disarm code for the drone, that really isn't something you should be thinking of yet and doesn't follow the given stories as we have discussed. You must first complete the basic code that establishes communication. Then, develop a test that will ensure that all communications that will be needed for drone flight works and run the test. Then, think about Arm and Disarm code. If you need Arm and Disarm code for the final testing, then you would want to add that into your test plan as a necessary element to be written. Otherwise, it can wait until after testing. |
Flip is always connected to Edison and Kainoa has it at this moment. I said Arm and Disarm because, it would be part of the next command I was going to test -MSP_SET_RAW_RC. I can just isolate the test to just test that one command. |
Ok, if you need to do the arm and disarm code it is fine. If you can write the test plan with notes as to why you will test the way you are and how you will move forward with it that would be great. Michael @spesialstyrker and I will try to see what we can find in your code. Please update your Wiki to tell us what code we should be looking at and how it is suppose to work (pseudo code unless the pseudo code for your algorithm is already in the code). |
@spesialstyrker @bhunt2 On Edison itself, it is located @root/Drone/drone.cpp |
@sabmah @Kekahuna @hautruong36 Please provide the settings for connecting to the Edison. Now that Kainoa has it, the IP has changed. Maybe you could have a wiki page for the connection information and instructions on how to do it. |
@bhunt2 @spesialstyrker @hautruong36 @Kekahuna |
@bhunt2 That makes sense. Thanks. Faust put Hau in charge of Final Acceptance Test plan. |
ok, but you could still have a final acceptance test plan for the flight load up your work into github and i can take a look. ben
|
@bhunt2 @spesialstyrker @hautruong36 @Kekahuna |
It looks good. I hope you have completed your test plan though. I haven't
|
Sorry it took a while. Faust really wanted to see the drone fly so I had to jot down on coding. I separated the test cases like you said from your comments earlier. I did not know what to do with expected result on throttle and throttle/pitch test. I could say it flies certain height and distance but I don't know how high it will fly given the frame. |
@sabmah @spesialstyrker Here is some feedback for what I see from the tests: Arm and Disarm Test:
MSP_Read
Throttle_Control
Throttle_Pitch
Please load the tests into GitHub instead of in your OneDrive. We use GitHub so that there is easy access to version control of the files. Please it makes it so that everyone can learn from your example of a good test plan. Good job and keep it up. |
The other option is to have the instructions in the Setup section as long as you don't need different instructions for different steps. If you have different instructions for different steps, they should be placed appropriately with the steps themselves. |
Now, if you feel that the your documentation is good enough, you can reference your documentation in the setup section for the Tester to go to and view instructions that would make sense for accomplishing the steps. This does not mean have the instructions for the specific steps in your documentation, but having a reference for sending specific commands or how your control firmware works so that they can accomplish the test. As these kinds of things should be in your documentation anyway (i.e. go to this folder and type into the command line to arm the drone.) this may be your best option as it will also make sure that your documentation is in order. |
@bhunt2 Thank you this is helpful. I will keep it posted. |
@bhunt2 For read only values like attitude where values depends on what position is the Flight Controller , can I have column that says Expected Total Bytes? https://github.com/bhunt2/QC1.0/blob/master/Sabin-Code/TestCases/Test_case_msp_read.pdf |
it should state what the bytes are going to look like. these many bytes and
|
@sabmah @spesialstyrker The changes I see to the test are looking much better and more defined. There is still some things that can be misunderstood by using different data types in the fields for bytes being sent and received. Header: $M< (each of these characters are 8-bit char) Do you see how these things can be interpreted incorrectly by someone who does not have a good idea of how things work? I understand what it is because I have worked with it, but when you send this to Dr. McNames and Prof. Faust they won't have that background knowledge and will easily be confused by what you are doing. On the other hand, again this has to with the greater level of ambiguity you had in your previous test, I did not know that you actually had command line arguments for running your tests. Since you have that, you don't need to state anything about the frames. You just need to supply the command line commands and arguments to perform the tests as you have done in this most recent update. This with the expected result is all that is needed. The comments field can be used to state specific information about the pass or fail of that step if needed. Keep it up, this is looking good and you are on your way to getting it all done. |
@bhunt2 Thanks. I will revise my documents and post them again. |
of course, if it is something that will be apart of the system it should be
|
Hey @bhunt2 , Here is the test plan: https://github.com/bhunt2/QC1.0/wiki/Drone-Control-Test-Plan I also documented the Automation Code Overview: https://github.com/bhunt2/QC1.0/wiki/Automation-Code-Overview I will be adding more to it. Thanks, |
This is looking good. Great work over this passed week. I look forward to seeing the test results. Here are my comments about the tests. MSP_Read Test:
Arm and Disarm Test: Looks good Throttle Test:
Pitch and Throttle Test: Same as the Throttle test comments. Once those issues are considered or taken care of then you can continue. |
@bhunt2 Thanks for the response. I will reflect these on the next update. |
@bhunt2 Updated API and Modeling https://github.com/bhunt2/QC1.0/wiki/Automation-Code-Overview |
This looks good, but I have some questions. The height is calculated by image processing?
|
@Kekahuna is sending me the height. I think he is actually setting as a constant height in his code |
you guys need to talk about that. having a constant height will only work If he is getting height some how, please provide me with a link of how it thanks
|
The user inputs the height of the object to be tracked at the same time that the user uploads the image to the drone during the initialization stage. My code uses that height to perform the necessary calculations to get the distance of the object to the camera. |
@bhunt2 I made changes to the test plan with your suggestions. https://github.com/bhunt2/QC1.0/wiki/Drone-Control-Test-Plan I don't know how to get the propeller rate so I changed the test to avoid knowing that. I'm stepping up the throttle by 5 on each key press. |
The setup instructions still states that the yaw, pitch, and roll are going to be set to a minimum value. Hau informed you that this needs to be 1500 for those as it is the mid point for those, in other words, it is zero and above 1500 is positive and below it is negative. Also, I still do not see any reference to the rate at which you will increase or decrease the values. You have what the increment is, but what is the rate at which you will be making those changes? So, you will push the up arrow for example every second, or every five seconds. You need to allow enough time for the drone to react according to your command and settle before you change it again. This is not only the safest method, but it allows you to see exact what the results of your choices are. You might find that steps of 5 is too much especially when the drone nears a thrust point that will cause it to continue upward indefinitely. I believe you can use these initial tests to collect data so that you can determine the appropriate throttle values. Just don't forget that you shouldn't just be hitting the arrow keys without thinking about what the physical result is going to be. |
Ok, I retract my statement that it is in the kit. I thought I had given you one, but I think I kept it. |
Please post information about what is happening here. Even just links to your documentation and tests is acceptable. This issue is a place for us to be able to work communicate with each other about the problem.
The text was updated successfully, but these errors were encountered: