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

ros2 branch has ros1 headers #235

Open
ashBabu opened this issue Aug 8, 2023 · 6 comments
Open

ros2 branch has ros1 headers #235

ashBabu opened this issue Aug 8, 2023 · 6 comments

Comments

@ashBabu
Copy link

ashBabu commented Aug 8, 2023

Hi, I would like to use sound_play in ros2 C++. The aim is that when an obstacle is detected (ros2 subscriber), provide an audio alert to the user.
I followed the this and got it to work by
ros2 run sound_play soundplay_node.py and ros2 run sound_play say.py "Hello". However when I do,

#include <sound_play.h>

class sound
{
sound_play::SoundClient sc_;
}

this starts complaining about ros1 headers.
Any fixes for this?

@knorth55
Copy link
Member

knorth55 commented Aug 8, 2023

I haven't implemented sound_play.h into ROS2 yet.
Your contribution is welcome, but I recommend to use python version.

BTW, can you paste full error log?

@ashBabu
Copy link
Author

ashBabu commented Aug 8, 2023

Hi, thanks for the reply. I have removed all the sound_play stuff from my program and hence dont have a full error log now. From memory, I can say that these lines were the main causes and wherever ros::Nodehandle is used

@knorth55
Copy link
Member

knorth55 commented Aug 8, 2023

I think including sound_play.h for ros2 is useless, because it doesn't support ros2....

@ashBabu
Copy link
Author

ashBabu commented Aug 8, 2023

I am actually migrating to ros2 from ros1. The sound_play.playWave() really worked for me in ros1. So was just trying to replicate the same in ros2.
Any other suggestions are welcome

@antbono
Copy link

antbono commented Sep 5, 2023

Thank you for this issue... I'm trying to compile sound_play in ros2 rolling but i got this error

CMake Error at /opt/ros/rolling/share/ament_cmake_python/cmake/ament_python_install_package.cmake:141 (add_custom_target):
  add_custom_target cannot create target
  "ament_cmake_python_build_sound_play_egg" because another target with the
  same name already exists.  The existing target is a custom target created
  in source directory
  "/home/toto/Gdrive/uni/robocup/robocup_ws/src/audio_common/sound_play".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/rolling/share/ament_cmake_python/cmake/ament_python_install_package.cmake:39 (_ament_cmake_python_install_package)
  CMakeLists.txt:36 (ament_python_install_package)

I think because sound_play.h is only for ros1

@knorth55
Copy link
Member

knorth55 commented Sep 5, 2023

@antbono no.
your issue is different and it is reported in #227.
please check #227 to avoid the error.

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