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

Replace offboard control setpoint topic with simple offboard control mode topic, remove setpoint data from topic #1786

Merged
merged 17 commits into from
Feb 28, 2015

Conversation

thomasgubler
Copy link
Contributor

This is a cleanup/rework of how mavlink offboard setpoints are handled. Because I plan to add offboard control support to ros sitl (in the mavlink dummy node) this was an important first step.

  • No functionality change is intended.
  • The PR is not tested yet.

@mhkabir @sjwilks please have a look

Overview of Changes

  • Replace offboard_control_setpoint with offboard_control_mode
  • Remove all setpoint data from the topic as it's not used anymore
    (setpoint data is directly routed into position/attitude setpoint topics
    for some time now)
  • Remove mode enum and replace with ignore booleans which map better to
    the mavlink message
  • Mavlink: Rework parsing of offboard setpoints
  • Commander: in offboard mode set control flags based on ignore flags
    instead of enum

TODO

  • Check why velocity control does not work

@aerialhedgehog
Copy link
Contributor

looks like this still uses the same mavlink messages, so the c_uart_example should be unaffected

@thomasgubler
Copy link
Contributor Author

@aerialhedgehog yes the change is Firmware internal only. Thanks for checking the c_uart_example

@LorenzMeier
Copy link
Member

This looks great and like a really neat simplification!

@thomasgubler
Copy link
Contributor Author

I just realised that this does not work in the current state if the sender uses an asynchronous pattern to send the data.
E.g send alternating set_attitude_target with throttle ignored (containing attitude data) and set_attitude_target with attitude ignored (containing throttle data).

Mavros uses exactly this pattern.

Maybe I need to add a mode enum again. However it will be simplified compared to the old version.
Another solution would be to ignore the ignore flags of the mavlink message if all attitude data (= {q, body angular rates}) is ignored.

@mhkabir
Copy link
Member

mhkabir commented Feb 16, 2015

@thomasgubler This is something we want to resolve in mavros itself.
The core of the issue being, we don't have any standard ROS message to transport an attitude target + throttle.
The ideal thing here would be to implement custom messages according to the SIG (http://wiki.ros.org/sig/MicroAirVehicle), but we've been holding off until the spec stabilizes. Perhaps we can implement the setpoint custom messages now and release them as a separate package.

@thomasgubler
Copy link
Contributor Author

@mhkabir I pushed an quick attempt for a fix. I will have to recheck tomorrow if I got the logic right.

@thomasgubler
Copy link
Contributor Author

I rebased and improved the attitude logic

@thomasgubler
Copy link
Contributor Author

by @aerialhedgehog in #1810

Firmware/offboard (ref PR #1786)
velocity control - does not move
position control - works, but i can't control how fast it moves to the next set point

I updated the todo list in the top comment to reflect this.

@LorenzMeier
Copy link
Member

@aerialhedgehog Would you have time to look at the velocity control bits?

@matt-beall
Copy link

I'm currently working on adding functionality to accept actuator control mavlink messages in the mavlink_receiver and to be able to set raw actuator controls while in offboard mode. The work in this branch will change how my code is working. I wonder the work should be combined? My fork is here: https://github.com/mcsauder/Pixhawk-Firmware/tree/actuatorControlOffboardMode

I've already merged the offboardmode code into my repo. Since my work is dependent on the offboard mode, should I submit a pull request for this to the offboardmode branch or simply to master?

@LorenzMeier
Copy link
Member

@matt-beall Thomas will be able to provide more feedback. In general sending the PR against the offboardmode branch might make sense because it will make your changes more obvious. As it will go into master as well I don't see it delaying your work going into master.

@thomasgubler
Copy link
Contributor Author

@matt-beall cool, looking forward to it! If this PR is still open once you are ready for a PR then you should do your PR against this branch. Otherwise against master. I would recommend that you frequently rebase your branch against this one while you are working on the feature.

@thomasgubler
Copy link
Contributor Author

@aerialhedgehog What kind of setpoint did you send in your velocity setpoint test? How/by which tool was the setpoint generated? Was it a pure velocity setpoint or a combination of velocity and position?

@thomasgubler
Copy link
Contributor Author

I glanced over the code again, but I could not immediately see whats wrong with velocity setpoints.
@LorenzMeier would merging this and opening an issue to the regression be acceptable? I guess velocity setpoints are used by a very small fraction of the people merging regularly form master. Not merging this PR is blocking other branches.

thomasgubler and others added 8 commits February 28, 2015 15:19
Replace offboard_control_setpoint with offboard_control_mode
Remove all setpoint data from the topic as it's  not used anymore
(setpoint data is directly routed into position/attitude setpoint topics
for some time now)
Remove mode enum and replace with ignore booleans which map better to
the mavlink message
Mavlink: Rework parsing of offboard setpoints
Commander: in offboard mode set control flags based on ignore flags
instead of enum
if attitude/rates haven been used previously do not set the ignore flags
even if the message asks us to do so to keep the controllers running
@LorenzMeier
Copy link
Member

@thomasgubler Makes sense. We want to keep moving ;-).

LorenzMeier added a commit that referenced this pull request Feb 28, 2015
Replace offboard control setpoint topic with simple offboard control mode topic, remove setpoint data from topic
@LorenzMeier LorenzMeier merged commit 1df0f25 into master Feb 28, 2015
@LorenzMeier LorenzMeier deleted the offboardmode branch February 28, 2015 16:47
PX4BuildBot added a commit that referenced this pull request Jan 19, 2022
    - mavlink in PX4/Firmware (9ee5b35): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@f5694b2
    - Changes: mavlink/mavlink@3d80920...f5694b2

    f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
PX4BuildBot added a commit that referenced this pull request Jan 20, 2022
    - mavlink in PX4/Firmware (9f790af): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@f5694b2
    - Changes: mavlink/mavlink@3d80920...f5694b2

    f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
PX4BuildBot added a commit that referenced this pull request Jan 20, 2022
    - mavlink in PX4/Firmware (b25df88): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@f5694b2
    - Changes: mavlink/mavlink@3d80920...f5694b2

    f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
PX4BuildBot added a commit that referenced this pull request Jan 21, 2022
    - mavlink in PX4/Firmware (057e0bc): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@f5694b2
    - Changes: mavlink/mavlink@3d80920...f5694b2

    f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
PX4BuildBot added a commit that referenced this pull request Jan 21, 2022
    - mavlink in PX4/Firmware (b6efbd0): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@51abf3c
    - Changes: mavlink/mavlink@3d80920...51abf3c

    51abf3c8 2022-01-21 Julian Oes - Component information: add note (#1785)
f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
PX4BuildBot added a commit that referenced this pull request Jan 22, 2022
    - mavlink in PX4/Firmware (a16a8dc): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@51abf3c
    - Changes: mavlink/mavlink@3d80920...51abf3c

    51abf3c8 2022-01-21 Julian Oes - Component information: add note (#1785)
f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
dagar pushed a commit that referenced this pull request Jan 22, 2022
    - mavlink in PX4/Firmware (a16a8dc): mavlink/mavlink@3d80920
    - mavlink current upstream: mavlink/mavlink@51abf3c
    - Changes: mavlink/mavlink@3d80920...51abf3c

    51abf3c8 2022-01-21 Julian Oes - Component information: add note (#1785)
f5694b29 2022-01-19 Julian Oes - component_info: re-use protocol capabilities (#1786)
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.

5 participants