Problem during Snapcraft : No such file or directory

Hey everyone, ok I am trying to package a ROS project as a snap, so first I have followed the tutorial to understand how it’s worked and after that try on my project.

The problem is one the picture that I have uploaded, and I clearly don’t really know how to fix this error… So if someone have sugestion for that, it will be nice.

My snapcraft.yaml

name: project-ros version: ‘0.1’ summary: ROS Example description: |

grade: stable confinement: strict

parts: workspace: plugin: catkin rosdistro: kinetic catkin-packages: [robot_msg_srv, robot_base]

CMakelist.txt (robot_base) :

cmake_minimum_required(VERSION 2.8.3) project(robot_base)

Compile as C++11, supported in ROS Kinetic and newer

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS robot_msg_srv serial message_generation )

add_message_files( FILES FaceLedMsg.msg )

generate_messages( DEPENDENCIES std_msgs )

catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS message_runtime serial )

include_directories( include ${catkin_INCLUDE_DIRS} ) add_executable(motor_node src/motor_node.cpp) target_link_libraries(motor_node ${catkin_LIBRARIES}) add_dependencies(motor_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(sensor_node src/sensor_node.cpp) target_link_libraries(sensor_node ${catkin_LIBRARIES}) add_dependencies(sensor_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(gyro_node src/gyro_node.cpp) target_link_libraries(gyro_node ${catkin_LIBRARIES}) add_dependencies(gyro_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(twist src/twist.cpp) target_link_libraries(twist ${catkin_LIBRARIES}) add_dependencies(twist ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(brushless_motor_node src/brushless_motor_node.cpp) target_link_libraries(brushless_motor_node ${catkin_LIBRARIES}) add_dependencies(brushless_motor_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(port_scanner_node src/port_scanner_node.cpp) target_link_libraries(port_scanner_node ${catkin_LIBRARIES}) add_dependencies(port_scanner_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(face_led_node src/face_led_node.cpp) target_link_libraries(face_led_node ${catkin_LIBRARIES}) add_dependencies(face_led_node ${${gobot_msg_srv}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

install(TARGETS port_scanner_node face_led_node sensor_node motor_node twist gyro_node brushless_motor_node DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )

CMakeList.txt (robot_msg_srv) :

make_minimum_required(VERSION 2.8.3) project(robot_msg_srv)

Compile as C++11, supported in ROS Kinetic and newer

add_compile_options(-std=c++11)

Find catkin macros and libraries

if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)

is used, also find other catkin packages

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs std_srvs tf nav_msgs actionlib costmap_2d sensor_msgs geometry_msgs actionlib_msgs move_base_msgs dynamic_reconfigure message_generation )

System dependencies are found with CMake’s conventions

find_package(Boost REQUIRED COMPONENTS system) add_message_files( FILES AllSensorsMsg.msg AlignmentMsg.msg BatteryMsg.msg BumperMsg.msg CliffMsg.msg IrMsg.msg OdomTestMsg.msg EncodersMsg.msg ProximityMsg.msg SonarMsg.msg WeightMsg.msg GyroMsg.msg MotorSpeedMsg.msg LedMsg.msg SoundMsg.msg StringArrayMsg.msg FaceLedMsg.msg )

Generate services in the ‘srv’ folder

add_service_files( FILES GetEncoders.srv InitBack.srv IsCharging.srv SendMessageToPc.srv SetSpeeds.srv SetBattery.srv SendMap.srv GetGobotStatus.srv SetGobotStatus.srv SetBool.srv GetString.srv SetString.srv GetInt.srv SetInt.srv GetStringArray.srv SetStringArray.srv GetIntArray.srv SetIntArray.srv SetFloatArray.srv SetLoopCount.srv )

Generate actions in the ‘action’ folder

add_action_files(

FILES

Action1.action

Action2.action

)

Generate added messages and services with any dependencies listed here

generate_messages( DEPENDENCIES std_msgs )

catkin_package( INCLUDE_DIRS include LIBRARIES robot_class

LIBRARIES gobot_msg_srv

CATKIN_DEPENDS 
    std_srvs
    tf
    nav_msgs
    actionlib
    costmap_2d
    sensor_msgs
    geometry_msgs
    actionlib_msgs
    move_base_msgs

DEPENDS system_lib

)

###########

Build

###########

Specify additional locations of header files

Your package locations should be listed before other locations

include_directories( include ${catkin_INCLUDE_DIRS} )

add_library(robot_class src/get_robot_class.cpp src/set_robot_class.cpp src/robot_move_class.cpp src/robot_command.cpp) add_dependencies(robot_class ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(robot_class ${catkin_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})

install(TARGETS robot_class ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )

Thank you for your help :slight_smile:

I’m sorry @Valou_bg, the notification email for this post totally went to my junk folder. Assuming this is still a problem, would you mind formatting your code a bit by surrounding it with three backticks (```)? Also, it looks like you’re missing the package.xml? I suspect the error is actually there, a missing dependency specifically.

1 Like

Hello @kyrofa,

I have fixed my error, was come from my CMakeList.txt. Thank you for your reply :slight_smile:

2 Likes

Very good! Again, I am sorry for the delay.