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

[DO_NOT_MERGE_YET] rotors_hil_interface: take advantage of MAVROS hil plugin #438

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TSC21
Copy link

@TSC21 TSC21 commented Oct 5, 2017

With this PR we take (almost) full advantage of MAVROS hil plugin. There, the unit conversions are applied, besides the frame transform to NED. I also applied the uncrustify style for C++. Let me know if you want me to revert this step.

@ethzasl-jenkins
Copy link

Can one of the admins verify this patch?

@TSC21
Copy link
Author

TSC21 commented Oct 5, 2017

@hitimo @pvechersky @helenol can you please take a look? Thanks

@TSC21
Copy link
Author

TSC21 commented Oct 5, 2017

Related #356, #367, #380, #402.

@@ -25,43 +25,51 @@ namespace rotors_hil {
// Default values
static constexpr bool kDefaultSensorLevelHil = true;
static constexpr double kDefaultHilFrequency = 100.0;
static constexpr double kDefaultBodyToSensorsRoll = M_PI;
Copy link
Author

Choose a reason for hiding this comment

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

My only question is here: on MAVROS, we apply ENU to NED transform (https://github.com/mavlink/mavros/blob/master/mavros/src/lib/ftf_frame_conversions.cpp#L30) and then base_link to body/aircraft frame (https://github.com/mavlink/mavros/blob/master/mavros/src/lib/ftf_frame_conversions.cpp#L37), while you just seem to apply this last one. Which frame of reference are we using in rotors_gazebo?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe Rotors uses the standard ROS reference frame of NWU, hence the rotation by 180 degrees around the x axis to convert it to NED in the HIL interface node in this case.

@TSC21 TSC21 changed the title rotors_hil_interface: take advantage of MAVROS hil plugin [DO_NOT_MERGE_YET] rotors_hil_interface: take advantage of MAVROS hil plugin Oct 5, 2017
@TSC21
Copy link
Author

TSC21 commented Oct 21, 2017

@hitimo @pvechersky @helenol can you give me your thoughts on this?

Copy link
Contributor

@pvechersky pvechersky left a comment

Choose a reason for hiding this comment

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

Conceptually, the changes are good. I think as much of MAVROS's built-in functionality should be leveraged by our HIL module, and using the hil plugin is a good step in that direction.

I just have a couple of higher-level comments that the other reviewers might follow-up on:

  1. In rotors_hil.rosinstall you change the MAVROS uri to the mavlink repo instead of the ethz-asl one. The switch to ethz-asl repo for MAVROS was done after my time of working on this HIL interface so I'm not sure if the Rotors admins would prefer to stick to the ethz-asl repo or not. But if the ethz-asl repo is preferred then perhaps relevant hil plugin changes in MAVROS can be merged into that repo?

  2. Code formatting. Rotors used Google coding standards I believe. See other C++ code in the project for reference.

Thank for integrating these improvements!

@TSC21 TSC21 closed this Dec 24, 2017
@TSC21 TSC21 reopened this Dec 24, 2017
@ethzasl-jenkins
Copy link

Can one of the admins verify this patch?

@helenol
Copy link
Contributor

helenol commented Dec 28, 2017

ok to test

@protobits
Copy link

Hi, I would like to use HIL and I'm blocked by #367 which I understand would be solved by this. What is needed to finish this PR?

@protobits
Copy link

Hi, anyone still looking into this? I tried this PR and everything mostly works. I have only two issues:

  1. mavros does not send hil_controls by default, it now send hil_actuator_controls so the first needs to be enabled somewhere or this interface adapted to parse hil_actuator_controls
  2. I tried both sensor and state level HIL and I'm not getting response from RC when raising throttle in manual mode. The actuator controls message even oscilates between all zeros and 0.5 for the first four controls.

@TSC21
Copy link
Author

TSC21 commented Jul 10, 2018

@v01d I got too much on my back to finish this, as I am also supporting and maintaining sitl_gazebo PX$ package. I will be happy to help you in debugging your problems though.

@protobits
Copy link

Cool thanks.
Well, the problem right now is that I cannot get the pixhawk to send anything but zeros on HIL actuator controls. I can arm and the actuator targets are set when changing throttle stick, but something inside pixhawk is not right. I believe I'm sending everything for manual control (IMU, MAG, pressure) so it should work. How can I debug this? I don't receive any strange message from pixhawk either.

@protobits
Copy link

Another question, is the mavlink interface plugin required? I'm not really sure what it is for, since the hil interface seems to do all the talking to mavros.

@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Jan 22, 2021

@TSC21 How should we move forward with this?

@Jaeyoung-Lim
Copy link
Member

test this please

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.

None yet

6 participants