Summary of problems and solutions encountered in the development of using ROS (updated)

Problem: The package cannot be found in rosrun or roslaunch

Option 1 : Source the ~/devel/setup.bash file. This solution is only temporary, and the same problem will still occur when opening a new terminal.
Option 2 : a once-and-for-all solution

Terminal operation: gedit ~/.bashrc
Add at the end of the file: source ~/catkin_ws/devel/setup.bash After
saving and exiting: source ~/.bashrc

Note: The second step above is just a relative path, and the specific path needs to be added according to your workspace.

Problem: Fix the *.bag.active package generated during record

  1. Switch to the directory where the xxx.bag.active file is located
  2. Enter rosbag reindex xxx.bag.active from the command line
  3. 输入rosbag fix xxx.bag.active result.bag

Note: If the third step command is not successful, add the –force option after the three commands

问题:ERROR:cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list

Enter the website: https://site.ip138.com/raw.githubusercontent.com/
enter and search the available ip: raw.githubusercontent.com
Use the terminal to ping the ip in the list, find the ip with the least delay, and add the ip to yourself Computer hosts file:

#Open the hosts file
sudo gedit /etc/hosts #Add
at the end of the file, the following ip is just a reference,
please refer to the result of my own search 151.11.84.133 raw.githubusercontent.com //This one passed the test on my computer #Save
and exit Try
sudo rosdep init
rosdep update again

Problem: sudo: rosdep: command not found

Install rosdep

sudo apt-get install python-rosdep

Problem: "Could not find a package configuration …" frequently encountered during catkin_make compilation

Just install the missing feature package directly, usually starting with ros-melodic (according to your own ros version), for example: it prompts that the "gazebo_ros_control" feature package is missing

sudo apt-get install ros-melodic-gazebo-ros-control

Guess you like

Origin blog.csdn.net/QLeelq/article/details/111189922