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

custom package build fails (micro-ROS)

asked 2023-01-18 17:10:27 -0600

PointCloud gravatar image

updated 2023-01-19 02:20:24 -0600

gvdhoorn gravatar image

This is NOT a duplicate question, please don't just close this topic. Provide some insight to where "the supposedly" duplicate question can be found. I have been looking through here to see if there are any similar questions, that might help solving the issues I'm facing. However, I wasn't able to find anything.

I'm building a custom package with custom message, based on oled_display_node

VS Code + PlatformIO building microros

before attempting I clean the environment, as so:

1. pio run --target clean_microros
2. platformIO: Clean (little trash-bin icon)
3. delete the .pio directory

Then I build as per below:

1. pio init
2. pio lib install
3. pio run

I have created the

DisplayOutput.msg

with the following content:

# Request to place text on the display.
# The display row and column as well as string specifics are required
# A comment field is used to assist user debug

# actionType values
uint8  DISPLAY_ALL=1              # Message to fill entire display
uint8  DISPLAY_SUBSTRING=2        # Message for a set of characters on one line
uint8  DISPLAY_STARTUP_STRING= 3  # Reserved for future use for non-volatile startup string
uint8  DISPLAY_SET_BRIGHTNESS= 4  # Sets display brightness. attributes is the brightness

int32  actionType                 # The type of action to be taken. See MSG_DISPLAY for values
int32  row                        # The display row of characters for this message
                                  # row can be from 0 to 7 where 0 is top line
int32  column                     # The starting horizontal pixel column
                                  # The column can be 0 - 118 where 0 is start at the left
int32  numChars                   # Number of characters to go to the display
int32  attributes                 # Used for brightness level 
string text                       # The text for this display update.  Up to 15 characters
string comment                    # Optional comment the user can use to document purpose

However, when I un-comment this line

"msg/DisplayOutput.msg"

inside my CMakeList.txt the compiler throws an error. (trace below)

CMakeList.txt cmake_minimum_required(VERSION 3.8) project(teensy_interfaces)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)

# -----------------------------
find_package(geometry_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "msg/Num.msg"
  "msg/Sphere.msg"
  "msg/Bool.msg"
  "msg/Int64.msg"
  "msg/String.msg"
  "msg/Int32.msg"
  "msg/UInt8.msg"
  "msg/DisplayOutput.msg"
  "srv/AddThreeInts.srv"
  "srv/NeoPixelControl.srv"
  "srv/OledDisplay.srv"
  DEPENDENCIES geometry_msgs std_msgs # Add packages that above messages depend on, in this case geometry_msgs for Sphere.msg
)
# -----------------------------

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()

package.xml

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>teensy_interfaces</name>
  <version>0.0.1< ...
(more)
edit retag flag offensive close merge delete

Comments

This is NOT a duplicate question, please don't just close this topic.

I've just checked, and #q411518, #q411519, #q411521 and #q411523 all appear to be the same question. If that's not the case, please clarify, and we can re-open the ones that are not duplicates.

And please note: #q411519 is still open, so technically, you've posted another duplicate with this question.

Provide some insight to where "the supposedly" duplicate question can be found

they are duplicates of your own question, posted multiple times. Probably due to a glitch in Askbot. You could check your account's activity to see for yourself.

In those cases we don't link to the other duplicates. They just get closed.

gvdhoorn gravatar image gvdhoorn  ( 2023-01-18 21:42:01 -0600 )edit

I didn't see that, but I recall there were some glitches posting and it came up with an error a few times, until I cut the length in half, then edited the post.

PointCloud gravatar image PointCloud  ( 2023-01-19 00:32:57 -0600 )edit

That's alright.

Seeing as this one now has an answer by @Pablogs, I suggest you close and delete the remaining duplicate now (ie: #q411519).

gvdhoorn gravatar image gvdhoorn  ( 2023-01-19 02:20:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-19 00:52:48 -0600

Pablogs gravatar image

As you can see in the CMake log, geometry_msgs is not found, because the Platform IO package does not include it by default. See default packages here. Just add also your package dependencies.

edit flag offensive delete link more

Comments

but it builds beforehand, when I leave the ""msg/DisplayOutput.msg"" line commented out. With this being commented out, it still references geometry_msgs. So I don't think that missing geometry_msgs can be the issue here.

PointCloud gravatar image PointCloud  ( 2023-01-19 02:25:50 -0600 )edit

Is it missing if Downloaded geometry_msgs appears in the build log?

gvdhoorn gravatar image gvdhoorn  ( 2023-01-19 02:31:35 -0600 )edit
1

You are right @gvdhoorn, geometry_msgs is include in common_interfaces and we do have the common_interfaces packages as default.

I'm not sure if you can set two packages in a single line in package XML: <depend>geometry_msgs std_msgs</depend> Maybe this is the cause of the lack of dependency in the build order.

Pablogs gravatar image Pablogs  ( 2023-01-19 02:41:01 -0600 )edit

I'm not sure if you can set two packages in a single line in package XML: <depend>geometry_msgs std_msgs</depend> Maybe this is the cause of the lack of dependency in the build order.

yes, that's most definitely a problem.

gvdhoorn gravatar image gvdhoorn  ( 2023-01-19 02:43:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-18 17:10:27 -0600

Seen: 716 times

Last updated: Jan 19 '23