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

Virtual Reality Integration #78

Closed
muhammete1 opened this issue Jul 24, 2021 · 13 comments
Closed

Virtual Reality Integration #78

muhammete1 opened this issue Jul 24, 2021 · 13 comments
Assignees
Labels
type: question Further information is requested wontfix This will not be worked on

Comments

@muhammete1
Copy link

Can we provide virtual-reality integration with using PWM datas which coming from Crazyflies? If it is not possible, is there any way to do this?

@gsilano gsilano self-assigned this Jul 25, 2021
@gsilano gsilano added the type: question Further information is requested label Jul 25, 2021
@gsilano
Copy link
Owner

gsilano commented Jul 25, 2021

Hi! If I get it correctly, you would like to use ROS, and therefore CrazyS, in the loop with the real device. Isn't it?

Well, firstly, why do you want to use CrazyS to control the Crazyflie? Crazyflie ROS is the most suitable package in this case. I would use MATLAB first, or any other numerical environment to test the path planning/control algorithm, then CrazyS (if you want to run a more advanced simulation that takes into account second-order effects as well as the onboard firmware), and then the real device.

Please note that CrazyS does not integrate the latest version of the firmware (it is still at the 2018.01 release). Therefore, you should check if the main functions, i.e., controller and state estimator, have been modified in the meantime.

I hope this helps.

@muhammete1
Copy link
Author

Hi! Yes, we are using Crazyswarm and we using drones for making variable formations. We want to give PWM variables and use them on CrazyS for virtual-reality environment. In other words, We want to simulate simultaneous on Crazys the commands that on impements real Crazyflies.

We already have tested algorithms on numerical and real environments. But we don't able to control our drones on CrazyS. We just want to operate virtual(CrazyS) and real devices simultaneously.

Additionally, we want to remind you that we are using Crazyswarm these all our stuides.

Thanks in advance.

@gsilano
Copy link
Owner

gsilano commented Jul 26, 2021

I see! Please, note that Gazebo only accepts SI measurements (i.e., meters per second, radians per second, etc.). Therefore, you need to convert PWM signals from propeller angular speeds expressed in radians per second. If you see the reference publications (see the book chapter in the Wiki), you will easily understand how to convert these values.

So, you need to write some glue code to interface Gazebo with your code. Here, there is a simple launch file that runs the Crazyflie without any controller.

@muhammete1
Copy link
Author

Thanks for your quick respond!

How can we apply this converted data to Crazyflie with Gazebo? How can we create our own controller? Is there any source that you can advice about this controller situation?

Thanks in advance.

@gsilano
Copy link
Owner

gsilano commented Jul 27, 2021

Well, as I said, it simply implements the equation referenced in the book chapter. As for the controller, you can use the book chapter as a guideline to implement the position controller (see the position_controller_node.cpp and position_controller.cpp as examples)

@muhammete1
Copy link
Author

Another question is how can we update version 2018.01 to version 2020.02? Is there any reference about it? Thanks in advance.

@gsilano
Copy link
Owner

gsilano commented Jul 31, 2021

You need to explore the firmware of the Crazyflie available in this repository. Next, compare the onboard controllers in CrazyS (i.e., crazyflie_complementary_filter.cpp and sensfusion6.cpp files) looking for differences/updates.

@semihsahhinx
Copy link

semihsahhinx commented Aug 5, 2021

position_controller_node.cpp ==> 512 ==> actuator_msg->header.stamp = odometry_msg->header.stamp;

Here, we changed values that sent to rotor. Below this line (512) we tried these values which taken by real drone but drone is not flying with these values only the propellers are running.

actuator_msg->angular_velocities[0] = 2000;
actuator_msg->angular_velocities[1] = 2000;
actuator_msg->angular_velocities[2] = 2000;
actuator_msg->angular_velocities[3] = 2000;

How can I solve this problem?

@gsilano
Copy link
Owner

gsilano commented Aug 6, 2021

You need to change the values in this file: crazyflie.xacro. Please, before doing this, read #56

@semihsahhinx
Copy link

semihsahhinx commented Aug 6, 2021

I see! Please, note that Gazebo only accepts SI measurements (i.e., meters per second, radians per second, etc.). Therefore, you need to convert PWM signals from propeller angular speeds expressed in radians per second. If you see the reference publications (see the book chapter in the Wiki), you will easily understand how to convert these values.

So, you need to write some glue code to interface Gazebo with your code. Here, there is a simple launch file that runs the Crazyflie without any controller.

As you mentioned, we should convert these values. But I couldn't find in book chapter. Can you please help me to convert these values?

@gsilano
Copy link
Owner

gsilano commented Aug 6, 2021

See page 9 in the book chapter

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 16, 2022
@gsilano
Copy link
Owner

gsilano commented Apr 16, 2022

Closed for inactivity.

@gsilano gsilano closed this as completed Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants