Git Product home page Git Product logo

Comments (11)

welcome avatar welcome commented on June 16, 2024

Thanks for opening your first issue here! Make sure that no other issues on the same topic have already been opened!

from crazys.

gsilano avatar gsilano commented on June 16, 2024

I took a look at the code. The actual Crazyflie control architecture does not allow to use the joystick. I will start working on this. Please, stay tuned on this issue for updates.
I will also update the README.md file with instructions.


EDIT

The issue is now related to the new milestones: 4.0.8, 5.02, 6.0.2.

from crazys.

gsilano avatar gsilano commented on June 16, 2024

I've just completed the interface for all releases of CrazyS releases. Tomorrow I will test it and let you know. If it works, I will merge it into the master (and the proper branches) and update the README.md file with instructions on how to use it.

from crazys.

gsilano avatar gsilano commented on June 16, 2024

The new feature has been added to the repository. Thus, I close the issue.

from crazys.

naiveHobo avatar naiveHobo commented on June 16, 2024

Thrust commands work as expected but the roll and pitch commands are not working. The drone is only able to take flight and not tilt as per the roll and pitch commands.

from crazys.

gsilano avatar gsilano commented on June 16, 2024

What do you mean exactly? Did you try to change the gains in the roll_pitch_yawrate_thrust_controller_crazyflie2.yaml file? It may be a problem related to the on-board control architecture.

from crazys.

naiveHobo avatar naiveHobo commented on June 16, 2024

But the roll_pitch_yaw_thrust_controller is not using the on-board controller. It has a rate and attitude controller of it's own, right?

I didn't change the gains in the yaml file but even without that it should be able to work right?

When I send only roll/pitch commands with the joystick without any thrust, the corresponding 2 adjacent propellers should start rotating, but that does not happen.

I echoed the PWMs and the PWM values constantly keep rising when the roll/pitch axis is kept at some value other than zero.

from crazys.

gsilano avatar gsilano commented on June 16, 2024

Yes, the file uses the Crazyflie’s onboard controller. As for the real device, when you control the drone by using the joypad, the onboard controller manages to drive the motors.

It depends. What do you mean with right?

No! If you don’t apply any thrust, the propellers will never rotate. If you don’t thrust me, try with real device if you have it.

I didn’t get the last point. Could you be more clear?

from crazys.

naiveHobo avatar naiveHobo commented on June 16, 2024

The RollPitchYawrateThrustControllerCrazyflie gets it's odometry from the gazebo odometry plugin, right? The state of the drone is set on the basis of this odometry message which is received in the world frame, which means that the attitude and angular velocities of the drone are set in the world frame.
However, the PWM calculations are done to give angular velocities to the motor in the local coordinate system of the drone.

To give an example, if the drone was facing backwards such that the back motors are pointing in +x direction and the front motors are pointing in the -x direction, and a pitch command is given to tilt the drone towards the +x direction, the motor angular velocities will be calculated such that the back motors rotate faster than the front motors and the drone will actually tilt towards the -x direction.

The odometry message will tell the drone that it is tilting towards the -x direction, but the pitch command received is still trying to achieve a +x tilt, so the PID controllers will keep increasing the delta_phi, delta_theta, delta_psi commands but will never be able to reach the setpoint.

Basically, the joystick commands being received and the motor angular velocities being calculated are in the local frame of the drone and the odometry messages received are in the world frame, which would yield incorrect results.

Does this sound right to you?

from crazys.

gsilano avatar gsilano commented on June 16, 2024

Yes, you are right. The RollPitchYawrateThrustControllerCrazyflie gets the drone state from the odometry message. As you can see from here, the odometry plugin expresses the linear and the angular velocities in body frame. If you don't trust (please, check for yourself because I could be wrong), try to rotate those measurements and see what happens.

What you are describing is modeled by the equations reported in the Control Mixer. To better understand the control architecture, I suggest you read what is described in the reference paper (you find all references in the Wiki).

I may not have understood correctly, but I don't totally agree with you. As you can see from the reference paper, tilting around the y-axis you generate a pitch angle (theta) and not w.r.t. x-axis. Also, the way that the pitch angle increase should be different. If you don't trust (again, I could be wrong), create the map (PWM equations mentioned before) between the motors spinning and the command signals. The rows of the matrix are the motors velocities, while the columns are the command signals, i.e., thrust, roll, pitch, and yaw rate.

from crazys.

naiveHobo avatar naiveHobo commented on June 16, 2024

Yes, you're right! Sorry, I made that error about the pitch angle, I meant rate. Thanks for being so prompt with the answers, this is brilliant work!

from crazys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.