Erro quando compilo um programa stack/package exemplo1 not found
Olá! Eu compilo este programa, mas quando vou executa-lo aparece essa msg Error: stack/package exemplo1 not found alguém pode me ajudar...
Segue abaixo o codigo CPP, mais o package.xml e o CMakeList.txt
exemplo1.cpp
// This program published randomly-generated velocity // messages for turtlesim.
include
include // For turtlesim::Velocity
include // For rand() and RAND_MAX
int main(int argc, char **argv) { // Initialize the ROS system and become a node. ros::init(argc, argv, "publish_velocity"); ros::NodeHandle nh;
// Create a publisher object. ros::Publisher pub = nh.advertiseturtlesim::Velocity( "turtle1/command_velocity", 1000);
// Seed the random number generator. srand(time(0));
// Loop at 2Hz until the node is shut down. ros::Rate rate(2); while(ros::ok()) { // Create and fill in the message. turtlesim::Velocity msg; msg.linear = float(rand())/float(RANDMAX); msg.angular = 2*float(rand())/float(RANDMAX) - 1;
// Publish the message.
pub.publish(msg);
// Send a message to rosout with the details.
ROS_INFO_STREAM("Sending random velocity command:"
<< " linear=" << msg.linear
<< " angular=" << msg.angular);
// Wait until it's time for another iteration.
rate.sleep();
} }
Conteúdo do arquivo package.xml
Conteúdo do arquivo CMakeList.txt
What version of CMake is needed?
cmakeminimumrequired(VERSION 2.8.3)
The name of this package.
project(exemplo1)
Find the catkin build system, and any other packages on which we depend.
findpackage(catkin REQUIRED COMPONENTS roscpp turtlesim stdsrvs)
Declare our catkin package.
catkin_package()
Specify locations of header files.
includedirectories(include ${catkinINCLUDE_DIRS})
Declare the executable, along with its source files.
add_executable(exemplo1 exemplo1.cpp)
Specify libraries against which to link.
targetlinklibraries(exemplo1 ${catkin_LIBRARIES})
Asked by alexprocopio on 2013-09-01 17:36:42 UTC
Comments