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

MAV rotors don not spin #626

Open
rishabbala opened this issue Jun 15, 2020 · 6 comments
Open

MAV rotors don not spin #626

rishabbala opened this issue Jun 15, 2020 · 6 comments

Comments

@rishabbala
Copy link

Hey, so I followed all the steps given here. I was able to build successfully on Ros Melodic Gazebo 9. I am able to spawn a world with the MAV. However when I give the rotor speed commands, the rotors do not spin. Any help would be great

Thanks

@mbdilaver
Copy link

mbdilaver commented Jun 17, 2020

Same problem here. This package was working fine on ROS Melodic about 6 months ago. I've decided to make a fresh installation of ROS Melodic on a Ubuntu 18.04 machine 3 months ago. It's not been working since then. I really wonder how something working became broken and not fixed for a long time.
Also there is no docker image or something. I wish I'd created a docker image while this package was working. It's sad.

@mbdilaver
Copy link

mbdilaver commented Jun 17, 2020

Hi! I've found a temporary solution. Go to rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt and add list(APPEND targets_to_install mav_msgs) line after the line target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs).

...
add_library(mav_msgs SHARED ${PROTO_SRCS})
target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)

list(APPEND targets_to_install mav_msgs) # <----- NEW LINE

# This causes mav_msgs to be linked with every created library in this file from this
# point forward.
# NOTE: This is deprecated, should be using target_link_libraries instead
link_libraries(mav_msgs)
...

Go to your workspace root and run the commands below.

catkin config --install
catkin build

Then go to .bashrc and add a source line for install directory of your workspace instead of devel like below.

source <your_workspace>/install/setup.bash

When I run hovering_example.launch it now works and flies.

roslaunch rotors_gazebo mav_hovering_example.launch 

References:
#506 (comment)
gsilano/CrazyS@86d80d3

@mbdilaver
Copy link

mbdilaver commented Jun 17, 2020

Also you can use catkin_make instead of catkin build and source your devel/setup.bash. Sourcing install directory may require additional work on CMakeLists.txt of other packages you have. After I compile with catkin_make drones fly without a problem with ROS melodic on Ubuntu 18.04.

Reference:
gsilano/CrazyS#40 (comment)

@rishabbala
Copy link
Author

Yeah its sad that some change causes so much problems.

Anyway, catkin_make didnt work for me. I used catkin_make_isolated, which compiled completely, but gave same non flying results. But for some reason, uninstalling and re-installing ROS made the simulation work. I havent checked fully, so still not entirely sure. Thank for this too, I'll try it out

@aka-LJ
Copy link

aka-LJ commented Aug 5, 2020

Hi! I've found a temporary solution. Go to rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt and add list(APPEND targets_to_install mav_msgs) line after the line target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs).

...
add_library(mav_msgs SHARED ${PROTO_SRCS})
target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)

list(APPEND targets_to_install mav_msgs) # <----- NEW LINE

# This causes mav_msgs to be linked with every created library in this file from this
# point forward.
# NOTE: This is deprecated, should be using target_link_libraries instead
link_libraries(mav_msgs)
...

Go to your workspace root and run the commands below.

catkin config --install
catkin build

Then go to .bashrc and add a source line for install directory of your workspace instead of devel like below.

source <your_workspace>/install/setup.bash

When I run hovering_example.launch it now works and flies.

roslaunch rotors_gazebo mav_hovering_example.launch 

References:
#506 (comment)
gsilano/CrazyS@86d80d3

Hi, I've tried this, but getting the error message, any idea which CMakeList.text I should work on? thank you.

ERROR: cannot launch node of type [rotors_gazebo/waypoint_publisher]: Cannot locate node of type [waypoint_publisher] in package [rotors_gazebo]. Make sure file exists in package path and permission is set to executable (chmod +x)

ERROR: cannot launch node of type [rotors_control/lee_position_controller_node]: Cannot locate node of type [lee_position_controller_node] in package [rotors_control]. Make sure file exists in package path and permission is set to executable (chmod +x)

@aka-LJ
Copy link

aka-LJ commented Aug 5, 2020

Hi! I've found a temporary solution. Go to rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt and add list(APPEND targets_to_install mav_msgs) line after the line target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs).

...
add_library(mav_msgs SHARED ${PROTO_SRCS})
target_link_libraries(mav_msgs ${PROTOBUF_LIBRARY} gazebo_msgs)

list(APPEND targets_to_install mav_msgs) # <----- NEW LINE

# This causes mav_msgs to be linked with every created library in this file from this
# point forward.
# NOTE: This is deprecated, should be using target_link_libraries instead
link_libraries(mav_msgs)
...

Go to your workspace root and run the commands below.

catkin config --install
catkin build

Then go to .bashrc and add a source line for install directory of your workspace instead of devel like below.

source <your_workspace>/install/setup.bash

When I run hovering_example.launch it now works and flies.

roslaunch rotors_gazebo mav_hovering_example.launch 

References:
#506 (comment)
gsilano/CrazyS@86d80d3

Hi, I've tried this, but getting the error message, any idea which CMakeList.text I should work on? thank you.

ERROR: cannot launch node of type [rotors_gazebo/waypoint_publisher]: Cannot locate node of type [waypoint_publisher] in package [rotors_gazebo]. Make sure file exists in package path and permission is set to executable (chmod +x)

ERROR: cannot launch node of type [rotors_control/lee_position_controller_node]: Cannot locate node of type [lee_position_controller_node] in package [rotors_control]. Make sure file exists in package path and permission is set to executable (chmod +x)

This is really strange, I manage to get the mav hovering example to work by building the CrazyS package instead of the BehopS package without any change.

CrazyS has three more lines in the install instruction than BelopS, maybe it's one of the following packages are missing in BelopS

$ sudo apt install ros-melodic-rqt-rotors ros-melodic-rotors-comm ros-melodic-mav-msgs ros-melodic-rotors-control
$ sudo apt install ros-melodic-rotors-gazebo ros-melodic-rotors-evaluation ros-melodic-rotors-joy-interface
$ sudo apt install ros-melodic-rotors-gazebo-plugins ros-melodic-mav-planning-msgs ros-melodic-rotors-description ros-melodic-rotors-hil-interface

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

No branches or pull requests

3 participants