Skip to content
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

[rotorcraft] add traffic_info to rotorcraft #1509

Closed
wants to merge 1 commit into from

Conversation

kirkscheper
Copy link
Member

Added drone to drone messaging to datalink.
Added ac traffic logging capability (TRAFFIC_INFO should be defined in airframe file).
Works with bluegiga (although I use a smaller message which isn't here yet)

@flixr
Copy link
Member

flixr commented Jan 6, 2016

Enabling generation of get_macros for telemetry again will break support for multiple variable length arrays again, see #1385

struct EcefCoor_i ecef_pos;
struct LlaCoor_i lla = {.lat = lat, .lon = lon, .alt = alt};
ecef_of_lla_i(&ecef_pos, &lla);
the_acs[the_acs_id[id]].east = (float)ecef_pos.x * 100;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecef.x is clearly not an east value, same for other parameters. This could be confusing in a future use. The structure should be probably extended to use proper position and speed formats.

@kirkscheper
Copy link
Member Author

How about this @flixr, only for printing macros, we just skip the fields after the variable length array. In the (far) future when it becomes necessary to read multiple arrays from a telemetry message onboard we can revisit this. How does that sound :)

@gautierhattenberger
Copy link
Member

Another option: if the message is aligned without variable length array, use old macro style (maybe they even can be improved), if not, use a new type of macro to fill the data byte by byte.
So it could work for any message of any class without loosing efficiency.
Also consider that their is an ongoing work to split the messages tools (libs, generator,...) into a separated sub project https://github.com/paparazzi/pprzlink (with Python generator) and the dev branch here: https://github.com/enacuavlab/paparazzi/tree/pprzlink
I'll make pull request when I'm done with the cleaning.

@flixr
Copy link
Member

flixr commented Jan 11, 2016

@gautierhattenberger would be great if you can resolve this together with @kirkscheper, I don't really have much time right now...

@kirkscheper
Copy link
Member Author

@gautierhattenberger let me know what you would like me to do with this in the interim till the pprzlink is complete. I would like to get this included in master soon so we can get the drone2drone in there. I need to solve the merge conflict with datalink.c first btw...

I would also like to start merging the rotorcraft and fixed wing datalink files btw. I was thinking of adding a subsystems/datalink/datalink.c file where all common datalink handling goes which then calls the firmware specific handling then the module datalink handling. This will reduce the maintenance and help get us to integrated firmware. I will do this in a different pull request though.

@gautierhattenberger gautierhattenberger mentioned this pull request Jan 14, 2016
@gautierhattenberger
Copy link
Member

@kirkscheper this is a tough question. PPRZLINK is almost ready, but since it is a big change, it would be nice to have a bit more feedback before merging. I still would like to do this soon to avoid blocking of developments like yours. There is no point in doing the job twice...
So my question is, assuming we have switched to PPRZLINK, what it really missing to have this working ? Only the alignment issue for telemetry messages ?
The other point that is annoying me as mentioned earlier is the traffic info structure itself where utm fields are used for rotorcraft. Since you didn't provide any code where this is used for rotorcraft (unless you're re-using the fixedwing modules straight ?), it is difficult to tell if it is wise or not to keep this format. e.g. should we have something more complex like the state interface where several formats can be stored and conversion are done on the fly depending of the actual needs.

@kirkscheper
Copy link
Member Author

So if you use the byte by byte approach as currently in the gen_messages then you don't need to align the telemetry messages but then you can't use multiple variable length arrays in the message.

In the original traffic_info, the position was saved as the utm_pos - nav_pos0. The the modules that use this position just compare that difference with the ecef position from the state. Of course this isn't very accurate as you move far away from the initial reference frame and as the initial position of the utm frame isn't loaded into the rotorcraft firmware I can't do that. The benefit is that those modules can actually be used in rotorcraft if the utm frame position is loaded in (as far as I can see).

ATM I am just using the full utm position of the intruder and computing the rotorcraft utm position using one of the api help functions. Alternatively, I can do the same hack as previously used by including the utm frame position or implement what you mentioned above. For now I am just trying to get it all working and along the way will try to find out what the most useful method is to receive and store all the required data.

@kirkscheper
Copy link
Member Author

Hey guys, just pulled the pprzlink changes but the dl macros are not generated for the telemetry messages for decoding messages onboard. Is there any plan to change this?

@gautierhattenberger
Copy link
Member

Yes, I want to improve the reading macros to work all the time with aligned data or not

@kirkscheper
Copy link
Member Author

Alrighty, well I will change this pull request to only update the tracffic code to include the lla messages and to add it to rotorcraft.

@kirkscheper kirkscheper changed the title [datalink]a start at drone to drone communication using telemetry msgs [rotorcraft] add traffic_info to rotorcraft Jan 30, 2016
@gautierhattenberger
Copy link
Member

We need to improve this in the future, but for now I guess it is fine like this. @flixr do you agree ?

@flixr flixr closed this in 08cf91e Jan 31, 2016
@kirkscheper kirkscheper deleted the d2d_messages branch January 31, 2016 15:59
gautierhattenberger added a commit that referenced this pull request Feb 4, 2016
- support aligned or non aligned data depending of the arch
- will help air-to-air communications (#1509)
flixr added a commit that referenced this pull request Feb 4, 2016
- support aligned or non aligned data depending of the arch
- Define PPRZLINK_UNALIGNED_ACCESS to TRUE if the target CPU/MMU allows unaligned access.
  This is true for x86/64 and most recent ARM platforms (ARMv7, Cortex-A, Cortex-M3/4).
  Examples for targets WITHOUT unaligned access support: LPC21xx, Cortex-M0
- will help air-to-air communications (#1509)
flixr added a commit that referenced this pull request Feb 4, 2016
- support aligned or non aligned data depending of the arch
- Define PPRZLINK_UNALIGNED_ACCESS to TRUE if the target CPU/MMU allows unaligned access.
  This is true for x86/64 and most recent ARM platforms (ARMv7, Cortex-A, Cortex-M3/4).
  Examples for targets WITHOUT unaligned access support: LPC21xx, Cortex-M0
- will help air-to-air communications (#1509)
gautierhattenberger pushed a commit that referenced this pull request Feb 4, 2016
- support aligned or non aligned data depending of the arch
- Define PPRZLINK_UNALIGNED_ACCESS to TRUE if the target CPU/MMU allows unaligned access.
  This is true for x86/64 and most recent ARM platforms (ARMv7, Cortex-A, Cortex-M3/4).
  Examples for targets WITHOUT unaligned access support: LPC21xx, Cortex-M0
- will help air-to-air communications (#1509)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants