ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

AibohphobiA's profile - activity

2023-06-07 14:56:49 -0500 received badge  Nice Answer (source)
2023-03-15 04:21:56 -0500 received badge  Famous Question (source)
2023-02-06 06:37:07 -0500 received badge  Notable Question (source)
2023-02-03 02:27:48 -0500 received badge  Nice Answer (source)
2023-02-02 06:35:20 -0500 received badge  Popular Question (source)
2023-02-02 03:34:21 -0500 marked best answer Adding custom message to existing package (Humble + Ubuntu22) fails

Hi there, I am trying to integrate an existing functioning package with a custom message(so far it has been divided to two projects).

I am failing when trying to modify the CMakeLists with the following interface:

rosidl_generate_interfaces(${PROJECT_NAME} 
  ${msg_files} 
)

I am getting the following error:

CMake Error at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:213 (add_custom_target):
  add_custom_target cannot create target "myPackage" because another target
  with the same name already exists.  The existing target is a shared library
  created in source directory "/home/user/ros2_ws/src/inuros2".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  CMakeLists.txt:110 (rosidl_generate_interfaces)

My Cmake up to that point is as follows:

cmake_minimum_required(VERSION 3.8)

project(myPackage)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")

  add_compile_options(-Wall -Wextra -Wpedantic)

endif()

find_package(ament_cmake REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rosidl_default_generators REQUIRED)

set (SOURCES
       ...
        )

set (INCLUDES
       ...
        )

add_library(${PROJECT_NAME} SHARED
        ${INCLUDES}
        ${SOURCES}
        )

set(dependencies
        cv_bridge
        rclcpp
        ...
        )

ament_target_dependencies(${PROJECT_NAME}
        ${dependencies}
        )

rclcpp_components_register_node(${PROJECT_NAME}
  PLUGIN "Class::NodeName"
  EXECUTABLE MyPackageExecutable
)

set(msg_files
  "msg/Features.msg"
)

rosidl_generate_interfaces(${PROJECT_NAME}
  ${msg_files}
)

Any help would be great.

Thanks!

2023-02-02 03:34:00 -0500 answered a question Adding custom message to existing package (Humble + Ubuntu22) fails

By using @stevemacenski 's example project, I was able to solve the issue. I basically generated two projects from the s

2023-01-30 02:33:27 -0500 commented answer I am unable to colcon build the ros2 workspace and getting these errors. if somebody please help me with this....

I am not familiar with Baxter, but seems like it was intended for ROS1. I would try to install ROS1 (probably Noetic), s

2023-01-30 02:33:27 -0500 received badge  Commentator
2023-01-26 06:45:34 -0500 asked a question Adding custom message to existing package (Humble + Ubuntu22) fails

Adding custom message to existing package (Humble + Ubuntu22) fails Hi there, I am trying to integrate an existing funct

2023-01-24 04:56:46 -0500 commented answer ROS2 get the class of a given topic

Now I get it. I don't think what you're asking for can be done through the API. Your best option is for your code to cal

2023-01-24 04:41:04 -0500 commented answer ROS2 get the class of a given topic

Hi lfb, As I mentioned before, you can run ros2 topic list through an terminal and get the type. I found an example on

2023-01-24 04:25:46 -0500 received badge  Teacher (source)
2023-01-24 00:55:10 -0500 commented answer Error building workspace of MoveIt 2 (Humble)

Would appreciate if you mark it answered. have a good one.

2023-01-23 07:35:53 -0500 answered a question Having problems with rclcpp no file or directory

Duplicated and answered.

2023-01-23 07:23:04 -0500 answered a question camera_info_manager with ROS2

Hi there, I'm not sure about Python API but I faced the same issue with C++. On ROS1, Camera_info_manager was a seperat

2023-01-23 06:54:11 -0500 answered a question I cant import sensor_msgs.point_cloud2

Many headers and naming conventions has changed in ROS2(got snake-cased). I'm not sure about python, but when using C++

2023-01-23 06:39:02 -0500 answered a question ROS2 get the class of a given topic

Your question is not entirely clear. topics are of type message - not class. As described in ROS2 Manual: If you want t

2023-01-23 06:31:20 -0500 answered a question I am unable to colcon build the ros2 workspace and getting these errors. if somebody please help me with this....

as GeorgNo mentioned above, your src file baxter_bridge.cpp is trying to include ros.h which is no longer relevant in RO

2023-01-23 06:20:42 -0500 edited answer Error building workspace of MoveIt 2 (Humble)

Hi there, stderr is a common output in ROS2 when building. usually, it doesn't mean it hasn't built properly and is ofte

2023-01-23 06:17:41 -0500 answered a question Error building workspace of MoveIt 2 (Humble)

Hi there, stderr is a common output in ROS2 when building. usually, it doesn't mean you it hasn't built and is often rel

2023-01-23 06:17:41 -0500 received badge  Rapid Responder (source)
2023-01-23 03:30:35 -0500 asked a question bloom-generate debian fails - ROS2 Humble on Ubuntu 20

bloom-generate debian fails - ROS2 Humble on Ubuntu 20 Hi there, I am trying to pack my package for ROS2 Humble on Ubunt

2023-01-22 16:47:50 -0500 received badge  Famous Question (source)
2023-01-17 08:36:14 -0500 commented question bloom-generate Rosdep can't resolve key

Hey there, just encountered this issue as well. Any ideas two + years later?

2022-05-26 00:37:44 -0500 received badge  Notable Question (source)
2022-05-24 04:47:32 -0500 received badge  Supporter (source)
2022-05-24 04:47:26 -0500 commented answer Can't init rosdep

Thanks for your help!

2022-05-24 04:47:16 -0500 marked best answer Can't init rosdep

Hi there, I'm trying to install ROS melodic and following: http://wiki.ros.org/melodic/Installat...

after calling:

sudo apt install python-rosdep

I follow up with:

sudo rosdep init

and getting:

ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize

I tried deleting and running init - which then asks me to update and goes back to the error above.

Any help would be great!

Thanks.

Full console log:

user@sharon-VirtualBox:~$ sudo rosdep init
ERROR: default sources list file already exists:
    /etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
user@sharon-VirtualBox:~$ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list 
user@sharon-VirtualBox:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
    rosdep update
user@sharon-VirtualBox:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/user/.ros/rosdep/sources.cache
user@sharon-VirtualBox:~$ sudo rosdep init
ERROR: default sources list file already exists:
    /etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
user@sharon-VirtualBox:~$
2022-05-24 03:06:39 -0500 commented answer Can't init rosdep

Oh wow, silly me. just waster a lot of time on nothing. Thanks for your help! btw, is there any was of testing that it'

2022-05-24 00:40:40 -0500 commented answer Can't init rosdep

Hi & thanks for the quick reply! I added the full console log to my original post. Maybe I didn't describe the prob

2022-05-24 00:39:03 -0500 edited question Can't init rosdep

Can't init rosdep Hi there, I'm trying to install ROS melodic and following: http://wiki.ros.org/melodic/Installation/Ub

2022-05-24 00:39:03 -0500 received badge  Editor (source)
2022-05-24 00:33:23 -0500 edited question Can't init rosdep

Can't init rosdep Hi there, I'm trying to install ROS melodic and following: http://wiki.ros.org/melodic/Installation/Ub

2022-05-23 23:55:48 -0500 received badge  Popular Question (source)
2022-05-23 08:57:10 -0500 asked a question Can't init rosdep

Can't init rosdep Hi there, I'm trying to install ROS melodic and following: http://wiki.ros.org/melodic/Installation/Ub

2022-04-05 09:45:45 -0500 marked best answer Cannot insert values in custom message

Hi and thanks for reading. I am trying to add a custom message to my project, but for some reason I cannot update the values. I simplified the message package to hold a simple String type which still doesn't work. the message catkin_pkg builds without any errors. features_msg.msg:

std_msgs/String tmp

in the .cpp file, I am calling:

    features_tracking_msg::features_msg features;
    features.tmp = "testing";

and getting: No viable overloaded '='

Any help would be appreciated!

2022-04-05 09:45:45 -0500 received badge  Scholar (source)
2022-04-05 09:45:34 -0500 commented answer Cannot insert values in custom message

Thanks! I don't know how, but in the following tutorial(which I used) he uses std_msgs::String and then assigns an std::

2022-04-05 09:45:34 -0500 received badge  Enthusiast
2022-04-02 09:12:36 -0500 received badge  Notable Question (source)
2022-04-01 01:20:39 -0500 received badge  Popular Question (source)
2022-03-31 08:31:18 -0500 asked a question Cannot insert values in custom message

Cannot insert values in custom message Hi and thanks for reading. I am trying to add a custom message to my project, but

2022-03-04 06:28:20 -0500 received badge  Famous Question (source)
2022-03-04 06:28:20 -0500 received badge  Notable Question (source)
2020-08-11 11:19:24 -0500 received badge  Popular Question (source)