Pelican + SDK 3.0 and ACI Remote communication

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Pelican + SDK 3.0 and ACI Remote communication

muhrix
Hello,

We have recently upgraded the firmware on the LLP and HLP of our Pelican to SDK 3.0.

We can successfully flash the firmware into the HLP using the AscTec USB board and the provided serial cable connected to HL_serial0 (we used flashmagic).

The problem is related to communication between HLP and an external computer over HL_serial0 using the AscTec USB board (same connection used to flash the firmware).

We tried to run the 4 example codes detailed in the ACI Remote Tutorials (found at asctec wiki page).
We could easily compile and run all 4 tutorials. However, none of them worked as they were supposed to at all, and there appears to be no communication between the compiled binaries (from the tutorials) and the Pelican.

On the AscTec USB board, the green LED flashes once, indicating something was sent to the HLP. Almost at the same time, the yellow LED flashes once, and that's all. Within the thread to receive data over the serial port, the calls to read(fd, ...) always return 0 (hence never is ever received).

Has anyone ever managed to make those tutorials work with the Pelican using SDK 3.0?
Would anyone be able to shed some light on this issue?

We have not modified anything in the tutorials' source code.

FYI, we are using Ubuntu 12.04 64-bits, we always make sure the cable is properly connected. Indeed, the Serial Switch (on the transmitter) was always enabled when we attempted to run the tutorials. We do have read/write permission to the serial port and, moreover, after re-flashing HLP with SDK 2.0, communication works fine with the asctec_mav_framework ROS package.

Any help will be much appreciated.
Best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

wayne
Does it work if you replace

while (result!=-1) {

with

while (result>0) {


?
Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

kr1zz
Hi,
we have just completed all of the tutorial except 3. To make them work it has been necessary to change the while condition as Wayne specified. Moreover we needed to flush standard out, i.e., adding
fflush(stdout) as follows:

tutorial 1
in
void versions(...)
at the end of the body function

tutorial 2
in
void *aciThread()
at the end of the if(var_getted)

As for what regards tutorial 3, the only way in which we managed to switch the motors on is by using ctrl_mode = 2 and giving CTRL_thrust = 0 and CTRL_yaw = -2047. Then give CTRL_yaw = 2047 to stop them.

Also, for those using a 64bit system, be sure to ask asctec for the latest version of asctecCommIntf.h

Did anybody managed to start the motors in DIMC mode?

Cristiano
Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

wayne
It is not possible to start the motors in DIMC mode.
That is a security issue. I don't recommend to test your code with any security pilot, you are not using the remote control. That's my own experience, I made years ago and also with coding of ACI. Better know, how to fly the system manual and react quickly, if your code is doing something weird than hoping that your code is working well.

The header file, I sent you, is already replaced in the downloads area. Also a 64-Bit version of ACI Tool is available.



Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

muhrix
Hi guys,

Thank you ever so much for the answers!!!
I do apologise for the delay; I was expecting to get email notifications when someone answered, but I didn't.
Luckily, a colleague checked the forum and told me about the answers.

I managed to run all tutorials, except Tutorial 3, just as @kr1zz described.

Regarding the condition of the while loops as @wayne suggested, yes, that helped!

Also, as @kr1zz pointed out, it appears that Asctec updated the ACI version available on the website. I did a diff between the version I had and the currently available version and they were indeed different. I reckon this was the major issue.

Weirdly, the versions are the same (v100), but the files were different. I'd be nice to see a bump in the version (e.g., v101)...

Anyway, I now need to figure out how to send the GPS waypoint struct to the HLP.

Thanks again!
Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

wayne
Sorry for not changing the version.
There are some changes in the wiki, which is now only read-only for a time.

The changes are only adding some functions declarations, which already exists in the cpp file in the header file. You only need it for 64-Bit systems. Actually, I didn't change "anything" in the code.  
Reply | Threaded
Open this post in threaded view
|

Re: Pelican + SDK 3.0 and ACI Remote communication

weigewansui
Hi Wayne,

I was trying to modify the sending command via HLP code. I was trying to control with attitude, (pith, roll, yaw, thrust) like LLP. However, I couldn't turn on the motor at all.

In your demo code, I feel really confused about where do you update the command? In the switch(motor) function, the motor values are changed but it's not been send out. Where is the command updated?

thank you!

Best,
Wei