Ask Your Question

sayed's profile - activity

2017-09-13 19:29:23 -0500 received badge  Famous Question (source)
2016-11-05 11:35:05 -0500 commented answer add library to new package

i guess the linking is good, but something wrong with my libraries

2016-11-05 11:23:17 -0500 commented answer add library to new package

in this link, the last version of CMakeList, after catkin_make, ros can read the mpu6050.h but it said that it has no members "the methods" like that iam using in the node file

2016-11-05 11:07:36 -0500 commented answer add library to new package

https://github.com/AhmedElsayedHamoud...

this is the whole WS .. i hope u reply and help me .. thankx in advance

2016-11-04 09:42:55 -0500 received badge  Notable Question (source)
2016-11-04 09:42:07 -0500 commented answer add library to new package

thankx for replying ,, i'll put the ws on git hub, i dont use it much, it'll take a while

2016-11-04 09:02:07 -0500 commented question add library to new package
2016-11-04 08:27:08 -0500 commented question add library to new package

i'll link it. mpu6050.h is in include directory

2016-11-04 07:35:40 -0500 received badge  Popular Question (source)
2016-11-04 06:23:44 -0500 commented answer add library to new package

sorry for the look

2016-11-04 06:22:28 -0500 answered a question add library to new package

this is my CMakeFile.txt

cmake_minimum_required(VERSION 2.8.3) project(mpu6050) find_package(catkin REQUIRED COMPONENTS rosconsole roscpp rospy sensor_msgs std_msgs ) catkin_package( INCLUDE_DIRS include LIBRARIES mpu6050 CATKIN_DEPENDS rosconsole roscpp rospy sensor_msgs std_msgs ) include_directories(include ${catkin_INCLUDE_DIRS} src/mpu6050/include/mpu6050 ) add_library(mpu6050 include/${PROJECT_NAME}/mpu6050.cpp include/${PROJECT_NAME}/I2Cdev.cpp ) add_executable(mpu6050_node src/mpu6050/src/mpu6050_node.cpp ) add_dependencies(mpu6050_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(mpu6050_node ${catkin_LIBRARIES} ) install(TARGETS mpu6050 mpu6050_node ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.h" )


2016-11-02 10:59:32 -0500 asked a question add library to new package

i'm working on a package for mpu6050 imu sensor, i have a ready library thats operate that sensor on ubuntu on pi3, i put the headers and cpp files on the include directory, and i used the example in that library to create the node, also i change the CMakeList.txt as the tutorial in the docs did

the problem when i do "catkin_make", when ros compile the node, it can't see the header, although the the compilation show that the cpp files of the libraries are built. i dont know what is the wrong, i guess it's my CMakeList.txt, can any one tell me the steps to add the library to my package ?

thank u in advance.

2016-11-02 10:06:22 -0500 asked a question add library to new package

im working on mpu6050 package, i have a library which is work well outside ROS, but i have a problem to make the package, i wrote a node and i added the headers an and the cpp files to include directory in my package , when i do catkin_make, the node can't see the headers , thats what i got:

/home/ahmed/catkin_ws/src/mpu6050/src/mpu6050_node.cpp:12:21: fatal error: mpu6050.h: No such file or directory
compilation terminated.
mpu6050/CMakeFiles/mpu6050_node.dir/build.make:62: recipe for target 'mpu6050/CMakeFiles/mpu6050_node.dir/src/mpu6050_node.cpp.o' failed
make[2]: *** [mpu6050/CMakeFiles/mpu6050_node.dir/src/mpu6050_node.cpp.o] Error 1
CMakeFiles/Makefile2:379: recipe for target 'mpu6050/CMakeFiles/mpu6050_node.dir/all' failed
make[1]: *** [mpu6050/CMakeFiles/mpu6050_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

i did changes to my CMakeList.txt as questions before me but nothing happened

any ideas ?? thank u in advance.


CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(mpu6050)

find_package(catkin REQUIRED COMPONENTS rosconsole roscpp rospy sensor_msgs std_msgs)

catkin_package( INCLUDE_DIRS include LIBRARIES mpu6050 CATKIN_DEPENDS rosconsole roscpp rospy sensor_msgs std_msgs )

include_directories(include ${catkin_INCLUDE_DIRS} src/mpu6050/include/mpu6050 )

add_library(mpu6050 include/${PROJECT_NAME}/mpu6050.cpp include/${PROJECT_NAME}/I2Cdev.cpp ) 

add_executable(mpu6050_node src/mpu6050/src/mpu6050_node.cpp )
add_dependencies(mpu6050_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 

target_link_libraries(mpu6050_node ${catkin_LIBRARIES} )

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

install(DIRECTORY include/${PROJECT_NAME}/ 
    DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
    FILES_MATCHING PATTERN "*.h"
)