Closed wonggwan closed 1 year ago
Thanks for opening your first issue here! Make sure that no other issues on the same topic have already been opened!
Hi! Think of my 'answers' with a grain of salt, I am no expert regarding this repo. I am just someone who used this repo recently as well.
For Issue 1, you publish the motor speed to /crazyflie/command/motor_speed
. I used the Matlab version of this repo, so I am not entirely sure how to publish
via script, but in Matlab, /crazyflie/command/motor_speed
needs input from mav_msgs/Actuators
and Propellers Angular Velocities (4) from Omegas (motor speed), see Fig. 11 (p.22) of the documentation that you refer to.
As for the units, I already forgot but I think it's in the docu as well.
As for Issue 2, I think it's correct as maybe the ones showed in Gazebo is rounded-up to 0.XX significant digits? Not entirely sure.
If you wait for a bit, your issues maybe resolved by the author of this repo, good luck!
Update for Issue 1 regarding the motor speed:
I found that the /CrazyS/src/CrazyFlie/rotors_control/src/nodes/roll_pitch_yawrate_thrust_crazyflie_node.cpp
is also publishing some sort of motor speed commands to gazebo apart from the /crazyflie2/command/motor_speed
one, what should we do about this? E.g. does these two node interfere each other during simulation in gazebo?
Hi! Think of my 'answers' with a grain of salt, I am no expert regarding this repo. I am just someone who used this repo recently as well.
For Issue 1, you publish the motor speed to
/crazyflie/command/motor_speed
. I used the Matlab version of this repo, so I am not entirely sure how to publish via script, but in Matlab,/crazyflie/command/motor_speed
needs input frommav_msgs/Actuators
and Propellers Angular Velocities (4) from Omegas (motor speed), see Fig. 11 (p.22) of the documentation that you refer to. As for the units, I already forgot but I think it's in the docu as well.As for Issue 2, I think it's correct as maybe the ones showed in Gazebo is rounded-up to 0.XX significant digits? Not entirely sure.
If you wait for a bit, your issues maybe resolved by the author of this repo, good luck!
Hi! Thanks for the help!
For Issue 1, now I also agree with you that we should publish the motor speed to the /crazyflie2/command/motor_speed
, but as my comments above mentioned, there is one more node named as /CrazyS/src/CrazyFlie/rotors_control/src/nodes/roll_pitch_yawrate_thrust_crazyflie_node.cpp
that is also publishing something towards the same topic, so I am not sure how is this affect my result.
As for Issue 2, since the drone is too light-weighted (roughly 30 grams), so any small change in the value will result in a very huge change in the calculation result. Since I am trying to use pure math calculation to 'simulate' how the drone fly, so I think the numbers will be crucial to the result.
Hi wonggwan! Glad to hear from you that you found my work helpful. Here are my answers:
Motor speeds are expressed in radians per second [rad/s]. If you want to control the drone, without using the provided controller, just run roslaunch rotors_gazebo crazyflie2_without_controller.launch
. Then, your code should publish on the /crazyflie2/gazebo/command/motor_speed
topic.
ROS Messages are defined in the mav_msgs
repository. Specifically, here you can find the definition of Actuators. You can find the maximum angular velocity in the the crazyflie2_base.xacro
and crazyflie2_forster.xacro
files. Since I have never tested the simulator with the Crazyflie, comparing the behaviors, I suggest you find your own parameters or rely on those in Forster's thesis.
I hope this helps. If not, let me know.
Hi wonggwan! Glad to hear from you that you found my work helpful. Here are my answers:
- Motor speeds are expressed in radians per second [rad/s]. If you want to control the drone, without using the provided controller, just run
roslaunch rotors_gazebo crazyflie2_without_controller.launch
. Then, your code should publish on the/crazyflie2/gazebo/command/motor_speed
topic.- ROS Messages are defined in the
mav_msgs
repository. Specifically, here you can find the definition of Actuators. You can find the maximum angular velocity in the thecrazyflie2_base.xacro
andcrazyflie2_forster.xacro
files. Since I have never tested the simulator with the Crazyflie, comparing the behaviors, I suggest you find your own parameters or rely on those in Forster's thesis.I hope this helps. If not, let me know.
Thank you so much for your help! I think that solves my current problem! Closing this issue now:)
Hi,
Thanks for the great repo! As I sent the email a few days ago that probably was not clear enough to state my question, I am sending all the related issues I have using this repo over here:)
My setup
I am using Ubuntu 20.04 with ROS Noetic and Gazebo 11 version and have already managed to setup & install all the things now
Issue 1: publishing motor speed to Gazebo via rostopic
After I managed to show the CrazyS robot in Gazebo, I was trying to control the drone via Python script by publishing the corresponding motor speed to the ROS topic.
My questions are as follows for the first issue:
As there seems to be multiple topic that is related to motor speed, which is the one that I should publish my information to and what is the unit of the motor_speed we publish (rpm or rad/s)?
I tried to publish my motor speed to the topic
/crazyflie2/command/motor_speed
which is using the message typemav_msgs/Actuators
, but when I find the corresponding information about this message type in ROS webpage, it showsBut I think the motor speed has a different unit
rpm
compared to the angular velocity of the actuatorrad/s
, how do we specify this when we publish our motor speed to Gazebo?What is the correct max angular velocity of the CrazyS in Gazebo? Is it 2618 rad/s?
When I try to publish some motor speed to the CrazyS, but as I subscribe the topic
/crazyflie2/motor_speed
, I found that the actual motor speed of the drone is not exactly following my command, e.g. I specified all 4 motors with 2418 rad/s, yet the drone motor speed kept bouncing around. Could you tell me what might be the issue?Issue 2: question regarding some coefficient & parameter setting to calculate the system dynamics of the CrazyS
My questions are as follows for the second issue:
Does the parameter match the physical configuration of the drone being used in Gazebo?
CrazyS/rotors_description/urdf/crazyflie2.xarco
showed that:which means the total mass will be 0.025 + 4*0.0005 = 0.027 kg.
Thank you so much!