Ask Your Question
0

Unable to create/find executable when using rosrun.

asked 2014-06-27 06:47:01 -0600

Abhishek Jha gravatar image

updated 2014-06-27 07:02:34 -0600

dornhege gravatar image

Hello all,

I am trying to run a C++ code to move the ur5 robotic arm to random configurations in moveit!. However when I am trying to run the code using rosrun I am getting the following error:

[rosrun] Couldn't find executable named move_group_interface_tutorial below /home/abhi/Desktop/universal_robot/ur_moveit_tutorials

The C++ file is this:

#include <ros/ros.h>
#include <moveit/move_group_interface/move_group.h>
int main(int argc, char **argv)
{
  ros::init(argc, argv, "lesson_move_group");

  // start a background "spinner", so our node can process ROS messages
  //  - this lets us know when the move is completed
  ros::AsyncSpinner spinner(1);
  spinner.start();

  move_group_interface::MoveGroup group("manipulator");
  group.setRandomTarget();
  group.move();
}

The CMakeLists.txt file is something like this:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)



rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/src)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

rosbuild_add_executable(lesson_move_group_1 src/lesson_move_group_1.cpp)
target_link_libraries(lesson_move_group_1 moveit_move_group_interface)

Please tell me how to create the executable and run this code. I am stuck here for quite some time now.

edit retag flag offensive close merge delete

Comments

can you please try to use the code tag (the button where the 1s and 0s are)

ct2034 gravatar imagect2034 ( 2014-06-27 07:02:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-06-27 11:11:01 -0600

Abhishek Jha gravatar image

I was able to solve this. I used the rosmake command.

$rosmake {package_name}

It helped create the executable and I was able to run it using rosrun.

edit flag offensive delete link more

Comments

So what have you done before instead?

ct2034 gravatar imagect2034 ( 2014-06-28 13:42:28 -0600 )edit

I was using cmake to build the packages. In that case I was not able to create the executable.

Abhishek Jha gravatar imageAbhishek Jha ( 2014-06-30 09:19:48 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-06-27 06:47:01 -0600

Seen: 145 times

Last updated: Jun 27 '14