In chapter 3, Following the instructons makes some errors.
The reason might be file structure of web shell is something wrong by mistake.
Could you help me refering to the picture attached?
Hi @SangcheolMoon ,
before running catkin_make, you have to move to the catkin_ws folder.
Please try this:
cd ~/catkin_ws
catkin_make
and let us know how it goes.
Hi, supporter!
I executed catkin_make and it works. But cd command doesnât.
Please check the screen capture bellow.
user:~/catkin_ws$ catkin_make
Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install
Running command: âmake cmake_check_build_systemâ in â/home/user/catkin_ws/buildâ
Running command: âmake -j8 -l8â in â/home/user/catkin_ws/buildâ
[ 0%] Built target actionlib_msgs_generate_messages_lisp
[ 0%] Built target actionlib_msgs_generate_messages_eus
[ 0%] Built target sensor_msgs_generate_messages_eus
[ 0%] Built target sensor_msgs_generate_messages_py
[ 0%] Built target geometry_msgs_generate_messages_py
[ 0%] Built target actionlib_msgs_generate_messages_nodejs
[ 0%] Built target sensor_msgs_generate_messages_cpp
[ 0%] Built target sensor_msgs_generate_messages_lisp
[ 0%] Built target nav_msgs_generate_messages_nodejs
[ 0%] Built target nav_msgs_generate_messages_lisp
[ 0%] Built target geometry_msgs_generate_messages_eus
[ 0%] Built target actionlib_msgs_generate_messages_py
[ 0%] Built target nav_msgs_generate_messages_py
[ 0%] Built target rosgraph_msgs_generate_messages_eus
[ 0%] Built target roscpp_generate_messages_py
[ 0%] Built target roscpp_generate_messages_cpp
[ 0%] Built target roscpp_generate_messages_eus
[ 0%] Built target roscpp_generate_messages_nodejs
[ 0%] Built target rosgraph_msgs_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_lisp
[ 0%] Built target rosgraph_msgs_generate_messages_py
[ 0%] Built target sensor_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target geometry_msgs_generate_messages_cpp
[ 0%] Built target actionlib_msgs_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_nodejs
[ 0%] Built target roscpp_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target nav_msgs_generate_messages_eus
[ 0%] Built target nav_msgs_generate_messages_cpp
[ 0%] Built target geometry_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target geometry_msgs_generate_messages_nodejs
[ 25%] Built target rosbot_control
[ 25%] Built target rosbot_class
Scanning dependencies of target unit2_exercise
Scanning dependencies of target unit3_exercise
[ 37%] Built target unit4_exercise
[ 50%] Built target unit5_exercise
[ 62%] Built target unit6_exercise
[ 75%] Built target unit1_exercise
[ 81%] Building CXX object cpp_course_repo/c_scripts/CMakeFiles/unit2_exercise.dir/src/unit2_exercise.cpp.o
[ 87%] Building CXX object cpp_course_repo/c_scripts/CMakeFiles/unit3_exercise.dir/src/unit3_exercise.cpp.o
[ 93%] Linking CXX executable /home/user/catkin_ws/devel/lib/c_scripts/unit2_exercise
[100%] Linking CXX executable /home/user/catkin_ws/devel/lib/c_scripts/unit3_exercise
[100%] Built target unit2_exercise
[100%] Built target unit3_exercise
user:~/catkin_ws$ cd ~/catkin_ws/src/cpp_course_repo/utilities/
bash: cd: /home/user/catkin_ws/src/cpp_course_repo/utilities/: No such file or directory
user:~/catkin_ws$
Hello @SangcheolMoon,
from your last post I understand that this command does not work, right?
cd ~/catkin_ws/src/cpp_course_repo/utilities/
In that case, please post here the output of this command:
ls ~/catkin_ws/src/
It should show this result:
CMakeLists.txt cpp_course_repo
If you donât see the cpp_course_repo
directory then you must hace skipped the step instructing to do a git clone https://bitbucket.org/theconstructcore/cpp_course_repo.git
inside the ~/catkin_ws/src/
directory.
Looking forward to your response,
Roberto
Hello Roberto,
I followed your instructions. But itâs not solved yet. The result is listed bellow.
user:~/catkin_ws$ cd ~/catkin_ws/src/cpp_course_repo/utilities/
bash: cd: /home/user/catkin_ws/src/cpp_course_repo/utilities/: No such file or directory
user:~/catkin_ws$ ls ~/catkin_ws/src/
CMakeLists.txt cpp_course_repo
user:~/catkin_ws$ ~/catkin_ws/src/
bash: /home/user/catkin_ws/src/: Is a directory
user:~/catkin_ws$ cd ~/catkin_ws/src/
user:~/catkin_ws/src$ git clone Bitbucket
fatal: destination path âcpp_course_repoâ already exists and is not an empty directory.
user:~/catkin_ws/src$
Hello supporters,
I followed other helpers advice and I havenât fixed the problem yet.
My feedback is as following. What else shoud I try?
Hello Roberto,
I followed your instructions. But itâs not solved yet. The result is listed bellow.
user:~/catkin_ws$ cd ~/catkin_ws/src/cpp_course_repo/utilities/
bash: cd: /home/user/catkin_ws/src/cpp_course_repo/utilities/: No such file or directory
user:~/catkin_ws$ ls ~/catkin_ws/src/
CMakeLists.txt cpp_course_repo
user:~/catkin_ws$ ~/catkin_ws/src/
bash: /home/user/catkin_ws/src/: Is a directory
user:~/catkin_ws$ cd ~/catkin_ws/src/
user:~/catkin_ws/src$ git clone Bitbucket
fatal: destination path âcpp_course_repoâ already exists and is not an empty directory.
user:~/catkin_ws/src$
Hi @SangcheolMoon,
could you run the commands below to list the content of catkin_ws/src?
cd ~/catkin_ws/src
tree .
If for any reason the system complains that the tree command does not exist, you can install it with:
sudo apt-get update
sudo apt-get install tree -y
Please paste here the output of the command mentioned in the beginning:
cd ~/catkin_ws/src
tree .
Hello ralves,
Here comes the oupput of the command for you.
One thing special is that the directory âcpp_course_repoâ is covered with green color.
user:~$ cd ~/catkin_ws/src
user:~/catkin_ws/src$ tree .
.
|-- CMakeLists.txt
`-- cpp_course_repo
|-- c_scripts
| |-- CMakeLists.txt
| |-- package.xml
| `-- src
| |-- unit1_exercise.cpp
| |-- unit2_exercise.cpp
| |-- unit3_exercise.cpp
| |-- unit4_exercise.cpp
| |-- unit5_exercise.cpp
| `-- unit6_exercise.cpp
`-- rosbot_control
|-- CMakeLists.txt
|-- include
| `-- rosbot_control
| `-- rosbot_class.h
|-- package.xml
`-- src
`-- rosbot_class.cpp
7 directories, 13 files
user:~/catkin_ws/src$
Hello @SangcheolMoon,
your latest answers and the output of the tree command indicate that the cpp_course_repo
exists but the utilities
directory which is inside the cpp_course_repo
folder does not.
This is strange since the utilities
folder is part of the cpp_course_repo
that you clone. Maybe it was deleted or moved to another location by mistake.
To reestablish the utilities directory you need two commands:
cd ~/catkin_ws/src/cpp_course_repo
and then:
git restore utilities
after that you will be able to execute this command here and continue with the exercise:
cd ~/catkin_ws/src/cpp_course_repo/utilities/
Note: this will not restore the files that you put inside the utilities
directory before, for instance boring_movie.cpp
from Chapter 2 (that file is lost).
Cheers,
Roberto
Hello Roberto,
I followed your instructions and the screen output is as follows.
It says one file is missing. Will it be okay?
user:~$ cd ~/catkin_ws/src/cpp_course_repo
user:~/catkin_ws/src/cpp_course_repo$ git restore utilities
error: unable to read sha1 file of utilities/README.md (f22ffd337f34a129acea0c720708db145dffa25e)
user:~/catkin_ws/src/cpp_course_repo$ cd ~/catkin_ws/src/cpp_course_repo/utilities/
user:~/catkin_ws/src/cpp_course_repo/utilities$ ll
total 8
drwxr-xr-x 2 user user 4096 Jun 5 01:24 ./
drwxrwxrwx 6 user user 4096 Jun 5 01:24 âŚ/
user:~/catkin_ws/src/cpp_course_repo/utilities$
Hello,
I guess the previous error is cleared. However, program execution result isnât same as the description.
When I executed Exercise 4.1, the rosbot moves forware about 1 meter and it stops without showing any laser values. The screen output is pasted bellow.
user:~$ cd ~/catkin_ws/src/cpp_course_repo/
user:~/catkin_ws/src/cpp_course_repo$ rosrun c_scripts unit4_exercise
[ INFO] [1685938007.841186373]: Initializing node âŚ
[ INFO] [1685938011.846265146, 5045.042000000]: 0.896455
user:~/catkin_ws/src/cpp_course_repo$
Hello @SangcheolMoon,
I am glad to hear that the issue with the cd command was solved.
Normally ask students to open a new question, whenever they have a new question that is unrelated to the previous question they have posted. This is to make it easier for other students to find answers to similar questions they might have.
With regards to Exercise 4.1 I tested the code provided as solution to the exercise and got this result:
[ INFO] [1685957453.834956534]: Initializing node .................................
[ INFO] [1685957455.835290666, 603.656000000]: Moving forward ...........
[ INFO] [1685957455.951625291, 603.756000000]: Moving forward ...........
[ INFO] [1685957456.074771160, 603.856000000]: Moving forward ...........
[ INFO] [1685957456.212246281, 603.956000000]: Moving forward ...........
[ INFO] [1685957456.315515990, 604.057000000]: Moving forward ...........
[ INFO] [1685957456.434252991, 604.156000000]: Moving forward ...........
[ INFO] [1685957456.575993771, 604.257000000]: Moving forward ...........
[ INFO] [1685957456.678155395, 604.356000000]: Moving forward ...........
[ INFO] [1685957456.799749214, 604.456000000]: Moving forward ...........
[ INFO] [1685957456.917040547, 604.556000000]: Moving forward ...........
[ INFO] [1685957457.036020990, 604.656000000]: Moving forward ...........
[ INFO] [1685957457.169255636, 604.756000000]: Moving forward ...........
[ INFO] [1685957457.287715115, 604.856000000]: Moving forward ...........
[ INFO] [1685957457.407487675, 604.957000000]: Moving forward ...........
[ INFO] [1685957457.528504820, 605.057000000]: Moving forward ...........
[ INFO] [1685957457.661780240, 605.156000000]: Moving forward ...........
[ INFO] [1685957457.788468549, 605.256000000]: Moving forward ...........
[ INFO] [1685957457.901044578, 605.356000000]: Moving forward ...........
[ INFO] [1685957458.026958071, 605.457000000]: Moving forward ...........
[ INFO] [1685957458.134767923, 605.557000000]: Moving forward ...........
[ INFO] [1685957458.247832044, 605.656000000]: Moving forward ...........
[ INFO] [1685957458.364666131, 605.756000000]: Moving forward ...........
[ INFO] [1685957458.487009728, 605.857000000]: Moving forward ...........
[ INFO] [1685957458.608055055, 605.956000000]: Moving forward ...........
[ INFO] [1685957458.730864089, 606.056000000]: Moving forward ...........
[ INFO] [1685957458.837593906, 606.156000000]: Moving forward ...........
[ INFO] [1685957458.965504270, 606.256000000]: Moving forward ...........
[ INFO] [1685957459.069626233, 606.357000000]: Moving forward ...........
[ INFO] [1685957459.191773581, 606.456000000]: Moving forward ...........
[ INFO] [1685957459.300779943, 606.556000000]: Moving forward ...........
[ INFO] [1685957459.424460286, 606.656000000]: The wall is at 9.32164 meters to the left, and at 1.68672 meters to the right from the robot
Which is similar to the expected result.
If are not getting this output, then please post a new question an also paste your code there to help us catch the error.
Cheers,
Roberto