wsnewman / learning_ros

repository to accompany "A Systematic Approach to Learning Robot Programming with ROS"
353 stars 234 forks source link

Part 3: lidar_wobbler: [rosrun] Couldn't find executable named wobbler_sine_commander #28

Open eliaskrchnr opened 9 months ago

eliaskrchnr commented 9 months ago

I tried following the tutorial on page 250. I could start gazebo and launch the lidar_wobbler.launch. When I tried executing rosrun lidar_wobbler wobbler_sine_commander I got the following error: [rosrun] Couldn't find executable named wobbler_sine_commander The file exists, the setup.bash is sourced and if I use roscd lidar_wobbler, the terminal finds the package.

elias@elias-ThinkPad:~$ cd ws_newman/
elias@elias-ThinkPad:~/ws_newman$ source devel/setup.bash
elias@elias-ThinkPad:~/ws_newman$ roscd lidar_wobbler
elias@elias-ThinkPad:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ tree -L 2
.
├── CMakeLists.txt
├── config
│   └── one_dof_ctl_params.yaml
├── launch
│   ├── laser_assembler.launch
│   └── lidar_wobbler.launch
├── model
│   └── lidar_wobbler.urdf
├── package.xml
├── README.md
└── src
    ├── assemble_scans_test_client.cpp
    ├── lidar_transformer.cpp
    ├── lidar_wobbler.cpp
    └── wobbler_sine_commander.cpp

4 directories, 11 files
elias@elias-ThinkPad:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander
[rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler

I'm a newbie at ROS, so the answer could be really simple, and I am missing something. My CMakeLists.txt is the same as in the repository, since I didn't change anything. I also deleted everything and cloned the repository again. Both times I got some error. A few of them regard the baxter package from Part 5, so it shouldn't affect me. The second error came in the end, and I could not find a reason for it online. It is: Invoking "make -j16 -l16" failed I'm grateful for every hint and advice. :)

wsnewman commented 9 months ago

I've seen this happen, and I'll confess I don't have a clear understanding of why. My work-around has been to roscd (navigate to your ROS workspace), then delete the "build" and "devel" subdirectories, then recompile.

After compiling, you should be able to find your executable under the "devel" directory (and ROS should know to look for it there).

On Sun, Jan 14, 2024 at 4:09 AM Elias Kirchner @.***> wrote:

I tried following the tutorial on page 250. I could start gazebo and launch the lidar_wobbler.launch. When I tried executing rosrun lidar_wobbler wobbler_sine_commander I got following error: [rosrun] Couldn't find executable named wobbler_sine_commander The file exists, the setup.bash is sourced and if I use roscd lidar_wobbler, the terminal finds the package.

@.:~$ cd ws_newman/ @.:~/ws_newman$ source devel/setup.bash @.:~/ws_newman$ roscd lidar_wobbler @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ tree -L 2 . ├── CMakeLists.txt ├── config │ └── one_dof_ctl_params.yaml ├── launch │ ├── laser_assembler.launch │ └── lidar_wobbler.launch ├── model │ └── lidar_wobbler.urdf ├── package.xml ├── README.md └── src ├── assemble_scans_test_client.cpp ├── lidar_transformer.cpp ├── lidar_wobbler.cpp └── wobbler_sine_commander.cpp

4 directories, 11 files @.***:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander [rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler

I'm a newbie at ROS, so the answer could be really simple, and I am missing something. My CMakeLists.txt is the same as in the repository, since I didn't change anything. I also deleted everything and cloned the repository again. Both times i got some error. E few of the regard the baxter package from Part 5, so it shouldn't affect me. The second error came in the end, and I could find a reason for it online. It is: Invoking "make -j16 -l16" failed I'm grateful for every hint and advice. :)

— Reply to this email directly, view it on GitHub https://github.com/wsnewman/learning_ros/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQAVWH6BI45YXXVYZTPY6TYOOOFPAVCNFSM6AAAAABBZ6PT4CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DANRUGYZDQOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Wyatt Newman, Ph.D., P.E. CTO, RoadPrintz, Inc. Professor Emeritus, ECSE Dept Case Western Reserve University

@. @.

eliaskrchnr commented 9 months ago

Thank you for the quick answer! I tried the workaround. I deleted build and devel and recompiled with catkin_make. Sadly, I got the same errors again. Invoking "make -j16 -l16" failed and

elias@elias-ThinkPad:~/ws_newman$ . devel/setup.bash
elias@elias-ThinkPad:~/ws_newman$ rosrun lidar_wobbler wobbler_sine_commander
[rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler
elias@elias-ThinkPad:~/ws_newman$ roscd lidar_wobbler
elias@elias-ThinkPad:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ tree -L 2
.
├── CMakeLists.txt
├── config
│   └── one_dof_ctl_params.yaml
├── launch
│   ├── laser_assembler.launch
│   └── lidar_wobbler.launch
├── model
│   └── lidar_wobbler.urdf
├── package.xml
├── README.md
└── src
    ├── assemble_scans_test_client.cpp
    ├── lidar_transformer.cpp
    ├── lidar_wobbler.cpp
    └── wobbler_sine_commander.cpp

4 directories, 11 files
elias@elias-ThinkPad:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander
[rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler
elias@elias-ThinkPad:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander.cpp
[rosrun] Couldn't find executable named wobbler_sine_commander.cpp below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler/src/wobbler_sine_commander.cpp

I forgot to mention that I am using ROS Noetic. Could that be an issue? Thank you! :)

wsnewman commented 9 months ago

ROS noetic should not be a problem. It looks like your ROS_WORKSPACE is set to ws_newman. Is that so? (look at output of: printenv). Try navigating to: ws_newman/devel/lib/...to the lidar lidar_wobbler directory. Do you see an executable under that called wobbler_sine_commander?

If so, try starting a ROS core (run roscore in some window, or start up a gazebo simulation). Then, from the above /devel directory, try executing: ./wobbler_sine_commander and see what happens.

This would diagnose a few things. If there is no executable, then the problem is with the compiler (e.g. CMakeLists.txt). If there is an executable and it runs, then the problem is with the ROS environment being confused about where to find its various body parts (which is likely related to /devel/setup.bash).

On Mon, Jan 15, 2024 at 3:31 AM Elias Kirchner @.***> wrote:

Thank you for the quick answer! I tried the workaround. I deleted build and devel and recompiled with catkin_make. Sadly, I got the same errors again. Invoking "make -j16 -l16" failed and

@.:~/ws_newman$ . devel/setup.bash @.:~/ws_newman$ rosrun lidar_wobbler wobbler_sine_commander [rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler @.:~/ws_newman$ roscd lidar_wobbler @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ tree -L 2 . ├── CMakeLists.txt ├── config │ └── one_dof_ctl_params.yaml ├── launch │ ├── laser_assembler.launch │ └── lidar_wobbler.launch ├── model │ └── lidar_wobbler.urdf ├── package.xml ├── README.md └── src ├── assemble_scans_test_client.cpp ├── lidar_transformer.cpp ├── lidar_wobbler.cpp └── wobbler_sine_commander.cpp

4 directories, 11 files @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander [rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander.cpp [rosrun] Couldn't find executable named wobbler_sine_commander.cpp below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler [rosrun] Found the following, but they're either not files, [rosrun] or not executable: [rosrun] /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler/src/wobbler_sine_commander.cpp

I forgot to mention that I am using ROS Noetic. Could that be an issue? Thank you! :)

— Reply to this email directly, view it on GitHub https://github.com/wsnewman/learning_ros/issues/28#issuecomment-1891557973, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQAVWCJQM2MNE7CBZ2QGUTYOTSPNAVCNFSM6AAAAABBZ6PT4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGU2TOOJXGM . You are receiving this because you commented.Message ID: @.***>

-- Wyatt Newman, Ph.D., P.E. CTO, RoadPrintz, Inc. Professor Emeritus, ECSE Dept Case Western Reserve University

@. @.

leegs commented 9 months ago

Hi,

I just freshly cloned the repository and specifically built the lidar_sine_wobbler executable. It built and ran. There must be an error occurring in the build process resulting the executable not being built.

Try using the following command:

catkin_make -i

If this works, it means that there is an error in the build process. (The -i tells make to continue in spite of errors.) It would be helpful for you to scroll through the output of the build process to find any errors, usually in red text.

I hope this helps.

Greg

On Tue, Jan 16, 2024 at 6:01 PM wsnewman @.***> wrote:

ROS noetic should not be a problem. It looks like your ROS_WORKSPACE is set to ws_newman. Is that so? (look at output of: printenv). Try navigating to: ws_newman/devel/lib/...to the lidar lidar_wobbler directory. Do you see an executable under that called wobbler_sine_commander?

If so, try starting a ROS core (run roscore in some window, or start up a gazebo simulation). Then, from the above /devel directory, try executing: ./wobbler_sine_commander and see what happens.

This would diagnose a few things. If there is no executable, then the problem is with the compiler (e.g. CMakeLists.txt). If there is an executable and it runs, then the problem is with the ROS environment being confused about where to find its various body parts (which is likely related to /devel/setup.bash).

On Mon, Jan 15, 2024 at 3:31 AM Elias Kirchner @.***> wrote:

Thank you for the quick answer! I tried the workaround. I deleted build and devel and recompiled with catkin_make. Sadly, I got the same errors again. Invoking "make -j16 -l16" failed and

@.:~/ws_newman$ . devel/setup.bash @.:~/ws_newman$ rosrun lidar_wobbler wobbler_sine_commander [rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler @.:~/ws_newman$ roscd lidar_wobbler @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ tree -L 2 . ├── CMakeLists.txt ├── config │ └── one_dof_ctl_params.yaml ├── launch │ ├── laser_assembler.launch │ └── lidar_wobbler.launch ├── model │ └── lidar_wobbler.urdf ├── package.xml ├── README.md └── src ├── assemble_scans_test_client.cpp ├── lidar_transformer.cpp ├── lidar_wobbler.cpp └── wobbler_sine_commander.cpp

4 directories, 11 files @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander [rosrun] Couldn't find executable named wobbler_sine_commander below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler @.:~/ws_newman/src/learning_ros/Part_3/lidar_wobbler$ rosrun lidar_wobbler wobbler_sine_commander.cpp [rosrun] Couldn't find executable named wobbler_sine_commander.cpp below /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler [rosrun] Found the following, but they're either not files, [rosrun] or not executable: [rosrun] /home/elias/ws_newman/src/learning_ros/Part_3/lidar_wobbler/src/wobbler_sine_commander.cpp

I forgot to mention that I am using ROS Noetic. Could that be an issue? Thank you! :)

— Reply to this email directly, view it on GitHub < https://github.com/wsnewman/learning_ros/issues/28#issuecomment-1891557973>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACQAVWCJQM2MNE7CBZ2QGUTYOTSPNAVCNFSM6AAAAABBZ6PT4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGU2TOOJXGM>

. You are receiving this because you commented.Message ID: @.***>

-- Wyatt Newman, Ph.D., P.E. CTO, RoadPrintz, Inc. Professor Emeritus, ECSE Dept Case Western Reserve University

@. @.

— Reply to this email directly, view it on GitHub https://github.com/wsnewman/learning_ros/issues/28#issuecomment-1894658028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4MZVA3TFAKJBBVDP4UUIDYO4BENAVCNFSM6AAAAABBZ6PT4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGY2TQMBSHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>