Basic Int32 and std_msgs question
I'm very new to working in Ros. I am trying to figure out how to read from a bag file and so I'm interested in making a small bag file for testing purposes. I have wrapped the code for writing the integer 42 inside a main function and attempted to run it within a catkin package using catkin_make. I get the following error:
[ 81%] Building CXX object test/CMakeFiles/test_write_bag.dir/src/test_write_bag.cpp.o
/home/ryan/catkin_ws/src/test/src/test_write_bag.cpp: In function ‘int main(int, char**)’:
/home/ryan/catkin_ws/src/test/src/test_write_bag.cpp:8:2: error: ‘Int32’ is not a member of ‘std_msgs’
std_msgs::Int32 i;
^
/home/ryan/catkin_ws/src/test/src/test_write_bag.cpp:8:18: error: expected ‘;’ before ‘i’
std_msgs::Int32 i;
^
/home/ryan/catkin_ws/src/test/src/test_write_bag.cpp:9:2: error: ‘i’ was not declared in this scope
i.data = 42;
^
make[2]: *** [test/CMakeFiles/test_write_bag.dir/src/test_write_bag.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_write_bag.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j1 -l1" failed
Does anyone know what I've done wrong or forgotten to set up within the project?