-
Notifications
You must be signed in to change notification settings - Fork 84
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
Missing blades after using my own controller #92
Comments
Ok! Just to understand. Are you able to run the examples mentioned in the README.md file? |
Yes. Examples work perfectly for me. |
Okay, so I think you missed things. There is simply a problem with the xacro file used to load the drone and create the links between the components. Start from the |
Thanks for your advice. However, My controller does not work in I want a crazyflie to move in circle in the simulation. The following is a part of codes in
|
Ok! So, the problem shouldn't be the launch file. In my experience, this error (the propeller suddenly disconnects from the drone's body as they fall to the floor) occurs when the controller doesn't publish the right content to drive the propellers. This could be related to the data format (i.e. the structure of the ROS message), the values (weird, but it can happen) or the topic name. Could you tell me the name of the topic and the values your Python script is pubblishing? Maybe you are not importing the controller correctly. I mean, there's a problem with the name path. I am not very familiar with Python scripts. So, could you check that the format is similar to the one used in the sample file present in the repository? if you check well, there is a scripts folder in "rotors_gazebo", inside there are some Python scripts that are used in the code. Try searching for the corresponding launch file using the GitHub search bar. If you have troubles in it, I will give you back with more precise instructions. |
So my controller will create a node called "sample_controller" and publish to the topic "DroneState". There are some parameters for x, y and z position in the DroneState. Like my start() function in codes for controller. I tried to make them keep updating and make a crazyflie move in simulation. At the first time, I wrote my controller to replace the existing controller called Are scripts in scripts folder about controller? I am not quite sure about it. Some existing controllers were implemented in C. |
OK! We got the issue. You can't publish there. You need to publish the propeller angular velocities (a mav_msgs::Actuators ROS message) on the mav_msgs::default_topics::COMMAND_ACTUATORS topic. You can find the name of the topic by looking at this link: https://github.com/gsilano/mav_comm/blob/master/mav_msgs/include/mav_msgs/default_topics.h. Have you read the papers that are linked to the repository? This is the link to the Publications: https://github.com/gsilano/CrazyS/wiki/Publications
|
Thanks for your help. I read the paper and checked links you gave me. But it seems that I did not explain what I am doing clearly.
|
Well, you can't do that because the current controller doesn't implement a trajectory tracking example. A PR (#86) was opened a while ago to add this functionality, but I haven't had time to finish the integration yet. So in case you want to take this idea further, you should also implement a trajectory tracking controller for Crazyflie. |
My current plan is writing a trajectory generator and publish to "crazyflie2/command/trajectory". However, I am confused with how "crazyflie2/command/trajectory" works. I used "rostopic echo" to monitor "crazyflie2/command/trajectory". "crazyflie2/command/trajectory" will publish to "position_controller" only once. If I use "hovering_example" as an example, the sequence of publishing should be "hovering_example" -> "crazyflie2/command/trajectory" -> "position_controller". I checked "hovering_example.cpp" and I have no clue about how coordinates got imported and updated. My guess it should be related to the following codes: nh_private.param("x", desired_position.x(), desired_position.x()); Could you help me understand where the trajectory file is and how the data is transferred to "position_controller"? Besides, I reinstalled my Ubuntu and reinstalled CrazyS. I always got some error while booting simulations. The following in error information: ERROR: cannot launch node of type [robot_state_publisher/robot_state_publisher]: robot_state_publisher However, my simulation still works for me. I followed installation in readme and sourced corresponding path. Whether there is something wrong with my configuration? |
Let me answer to your questions in order:
CrazyS/rotors_control/src/nodes/position_controller_node.cpp Lines 58 to 79 in 4e1537a
|
Very appreciate for your help and advices. I realized that I misunderstood how CrazyS works. Apologize for any inconvenience I brought to you. I am currently in a research about trajectory of crazy flies. My plan is developing a trajectory tracking controller now. Could you give me some clues about which topics I need to work with? For example, since I need to output the angular velocities of the prop, which topic I need to publish? |
Well, you can try to port in CrazyS this nice controller: https://github.com/bcbarbara/crazyflie_nmpc. This is a contribution from a friend of mine, but so far I have had time to integrate it. You could help out with this. It would be greatly appreciated. You need to publish on this topic: I hope this helps
|
Hi,
I am trying to use my own controller to control crazyflies in Gazebo. However, the blades of crazyflies will disappear and crazyflies will stay on the ground after using my own controller.
My controller codes:
In terms of my launch file, I used "crazyflie2_swarm_hovering_example" as my launch file but I deleted other crazyflies and kept only one left.
In order to use my own controller, I only changed
<node name="hovering_example_spline_swarm" pkg="rotors_gazebo" type="hovering_example_spline_swarm" output="screen" >
<rosparam command="load" file="$(find rotors_gazebo)/resource/sample_controller.py" />
by using
</node-->
<node name="customized_node" pkg="rotors_gazebo" type="sample_controller.py" />
"sample_controller" is the name of my controller file.
The given launch files worked successfully on my deceive. But I do not know what happened with my own controller.
Looking for any useful suggestions.
Thanks!
The text was updated successfully, but these errors were encountered: