added notes on add custom messages and some initial notes for the setup (required ros packages)
This commit is contained in:
parent
1bedc7f01d
commit
19ec0283bf
56
docu/notes_ros_messages.txt
Normal file
56
docu/notes_ros_messages.txt
Normal file
|
@ -0,0 +1,56 @@
|
|||
Creating ros package with catkin and adding custom messages:
|
||||
############################################################
|
||||
1. Create a workspace:
|
||||
----------------------
|
||||
$ mkdir catkin_ws
|
||||
$ cd catkin_ws
|
||||
$ mkdir src
|
||||
$ catkin_make
|
||||
$ source devel/setup.bash
|
||||
|
||||
2. Create the package:
|
||||
----------------------
|
||||
$ cd catkin_ws/src
|
||||
$ catkin_create_pkg <package_name> std_msgs rospy roscpp
|
||||
$ cd ..
|
||||
$ catkin_make # this build the package
|
||||
|
||||
3. Create the custom messages:
|
||||
------------------------------
|
||||
$ cd catkin_ws/src/<package_name>
|
||||
$ mkdir msg
|
||||
$ cd msg
|
||||
$ echo "int64 num" > Num.msg
|
||||
Then edit the package.xml file and add the following:
|
||||
<build_depend>message_generation</build_depend>
|
||||
<exec_depend>message_runtime</exec_depend>
|
||||
|
||||
Also edit CMakeLists.txt and to the find_package() function add:
|
||||
message_generation
|
||||
and to the catkin_package() add:
|
||||
CATKIN_DEPENDS message_runtime
|
||||
|
||||
Then, find add_message_files() (uncomment if necessary) and change it to the following:
|
||||
add_message_files(
|
||||
FILES
|
||||
Num.msg
|
||||
)
|
||||
|
||||
Finally, uncomment the generate_messages() function such that it reads:
|
||||
generate_messages(
|
||||
DEPENDENCIES
|
||||
std_msgs
|
||||
)
|
||||
|
||||
To build the new messages do the following:
|
||||
$ cd catkin_ws
|
||||
$ catkin_make # builds the new messages
|
||||
$ catkin_make install
|
||||
|
||||
As the last step, source the setup.bash:
|
||||
$ . install/setup.bash
|
||||
|
||||
Now the new messages should be available and you can find them with
|
||||
$ rosmsg list
|
||||
|
||||
Don't forget to source the setup.bash everytime you want to use the messages!
|
8
docu/notes_ros_setup.txt
Normal file
8
docu/notes_ros_setup.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
1. Install ROS (Robot Operating System) (see: http://wiki.ros.org/kinetic/Installation/Ubuntu)
|
||||
|
||||
2. Install the following dependencies:
|
||||
- cv_camera (see: http://wiki.ros.org/cv_camera):
|
||||
$ sudo apt-get install ros-kinetic-cv-camera
|
||||
- Aruco Marker detection using fiducials package (see: http://wiki.ros.org/fiducials)
|
||||
$ sudo apt-get install ros-kinetic-fiducials
|
||||
-
|
Loading…
Reference in New Issue
Block a user