Tag Archives: Automatic driving

Mmdetection reports an error when running its own coco dataset. Does not match the length of \ ` classes \ ` 80) in cocodataset

Mmdetection trains its own data set to report errors ⚠️ :

# AssertionError: The `num_ classes` (3) in Shared2FCBBoxHead of MMDataParallel does not matches the length of `CLASSES` 80) in CocoDataset

This means that the category (3) you specified does not match the category (80) of cocodataset.

You may have modified the following files, but you still report an error:

mmdetection-master\mmdet\core\evaluation\class_ names.py

 def coco_classes():
     return [
         # 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
         # 'truck', 'boat', 'traffic_light', 'fire_hydrant', 'stop_sign',
         # 'parking_meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
         # 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella',
         # 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard',
         # 'sports_ball', 'kite', 'baseball_bat', 'baseball_glove', 'skateboard',
         # 'surfboard', 'tennis_racket', 'bottle', 'wine_glass', 'cup', 'fork',
         # 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange',
         # 'broccoli', 'carrot', 'hot_dog', 'pizza', 'donut', 'cake', 'chair',
         # 'couch', 'potted_plant', 'bed', 'dining_table', 'toilet', 'tv',
         # 'laptop', 'mouse', 'remote', 'keyboard', 'cell_phone', 'microwave',
         # 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase',
         # 'scissors', 'teddy_bear', 'hair_drier', 'toothbrush'
         'lm','ls'
     ]

mmdetection-master\mmdet\datasets\coco.py

 class CocoDataset(CustomDataset):
     # CLASSES = (
     #     'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
     #            'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
     #            'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
     #            'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
     #            'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
     #            'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat',
     #            'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
     #            'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl',
     #            'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
     #            'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
     #            'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop',
     #            'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
     #            'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock',
     #            'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush'
     #     )
     CLASSES = ('lm', 'ls')

No more nonsense, go straight to the method. There are several methods:

one ️⃣ If you have two classes, you can replace the first two classes in the above two places with your classes. The method is relatively simple, but there may be hidden dangers.

two ️⃣ The second method is to modify the class_ After names.py and voc.py, the code must be recompiled (run Python setup.py install) and then trained.

I tried, but I still made the same mistake. Maybe my method is wrong.

reference resources:

New mmdetection v2.3.0 training test notes – it610.com

Mmdetectionv2. X version trains its own VOC dataset_ Peach jam Momo blog – CSDN blog

three ️⃣ The third method, which I use, is actually the same as recompilation. The reason for recompilation is that you report an error because the source file in the environment has not been modified. There are only some Python files in the mmdetection master directory. When the program is actually running, it is still the source file in the environment, because we directly modify the source file in the environment.

Suppose my CONDA environment is called CONDA_ env_ Name, so go to the following directory and modify two files respectively:

\anaconda3\envs\conda_ env_ name\lib\python3.7\site-packages\mmdet\core\evaluation\class_ names.py

\anaconda3\envs\conda_ env_ name\lib\python3.7\site-packages\mmdet\datasets\coco.py

Modify the categories in these two files in the CONDA environment.

⭐ In the end, I did my best to solve this bug and write this blog to help you avoid detours.

Ultimate solution to error reporting of sudo rosdep init of ROS

Error reporting solution for sudo rosdep init of ROS
when installing ROS, the sudo rosdep init command reports an error:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

In the process of installing ROS, I encountered the problem of sudo rosdep init reporting an error. I searched many tutorials and couldn’t solve it. Later, I referred to the tutorial at the end of the article and couldn’t deal with it. Later, I realized that the installation failed because the installation source corresponding to rosdep couldn’t be opened directly in China. Based on the principle that others will encounter their own problems, Stick to the search and finally find the corresponding source file in gitee (you can also search in chinacode). Therefore, refer to the tutorial at the end of the article. Only when the final file of the tutorial is modified, the original source file will be added to the link( https://raw.github.com/ros/rosdistro/master/ )Replace with the link in chinacode:( https://gitee.com/BlicNet/rosdistro/ )When you try to follow the tutorial again, The problem is solved and posted in memory.

1. If a version of other versions of ROS system has been installed before, delete the existing initialization file according to the prompt:

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

2. Add the content/ROS/rosdep/sources.list.d/20-default.list in the/etc directory again

cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

On some computers, there may be an error that MKDIR cannot create the package… The problem occurs because there is no permission to open related files. You can use the Chmod command to obtain permission

sudo chmod 777 /etc
    re execute the above command, open the 20-default.list file, copy the following contents into it, and save

    # os-specific listings first
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/osx-homebrew.yaml osx
    
    # generic
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/base.yaml
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/python.yaml
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/ruby.yaml
    gbpdistro https://gitee.com/BlicNet/rosdistro/releases/fuerte.yaml fuerte
    
    # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
    

    4. Open the terminal on the desktop and execute the command:

    rosdep update
    

    Solve the problem and keep working hard!

    Reference link

    Link: https://blog.csdn.net/qq_ 41058594/article/details/102970901.
    link: https://www.cnblogs.com/JuiceCat/p/12000953.html.

[ERROR] [1632398141.557684, 290.045000]: Spawn service failed. Exiting.

When executing the gazebo startup file it appears:

[ERROR] [1632398141.557684, 290.045000]: Spawn service failed. Exiting.

[urdf_spawner-6] process has died [pid 5510, exit code 1, cmd /opt/ros/noetic/lib/gazebo_ros/spawn_model -urdf -model mrobot -param robot_description __name:=urdf_spawner __log:=/home/wyf/.ros/log/28660358-1c66-11ec-aa75-efd91e7f34ce/urdf_spawner-6.log].
log file: /home/wyf/.ros/log/28660358-1c66-11ec-aa75-efd91e7f34ce/urdf_spawner-6*.log

Solution:

source ~/catkin_ws/devel/setup.bash

Execute the launch file again

Another problem is that the model file is not added

Ego planner swarm installation and error reporting solution

Project address: https://github.com/ZJU-FAST-Lab/ego-planner-swarmhttps://github.com/ZJU -FAST-Lab/ego-planner-swarm https://github.com/ZJU-FAST-Lab/ego-planner-swarm

The errors reported after compilation are as follows:

  After consulting the author, the reply is as follows:

But I didn’t know how to change the file the author said, so I asked/ego Planner/SRC/UAV_ simulator/Utils/multi_ map_ Modify server/cmakelists.txt as follows:

  After compiling successfully, run

roslaunch ego_planner rviz.launch
roslaunch ego_planner swarm.launch

The results are as follows:

ros2 apt-get install error: E: Failed to fetch http://packages.ros.org…

version: foxy

apt install

sudo apt-get install ros-foxy-serial-driver 
[sudo] password for mi: 
Sorry, try again.
[sudo] password for mi: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ros-foxy-serial-driver
0 upgraded, 1 newly installed, 0 to remove and 769 not upgraded.
Need to get 9,508 B of archives.
After this operation, 61.4 kB of additional disk space will be used.
Err:1 http://packages.ros.org/ros2/ubuntu focal/main amd64 ros-foxy-serial-driver amd64 0.0.6-1focal.20210423.022509
  404  Not Found [IP: 64.50.233.100 80]
E: Failed to fetch http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-foxy-serial-driver/ros-foxy-serial-driver_0.0.6-1focal.20210423.022509_amd64.deb  404  Not Found [IP: 64.50.233.100 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Apt update error:

W: An error occurred during the signature verification.
 The repository is not updated and the previous index files will be used.
 GPG error: http://packages.ros.org/ros/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <[email protected]>

Solution:

 curl http://repo.ros2.org/repos.key | sudo apt-key add -

Mgr [error]: library file libdmhs_exec.so not found, error: 0

DM8 reports an error when building DMHS
Mgr [error]: library file libdmhs_ Exec.so not found, error: 0

DMHS> start exec
CSL[ERROR]: Failed to load execution module

view log

MGR[INFO]: Loading execution module...
MGR[ERROR]: Library file libdmhs_exec.so not found, Error: 0
MGR[ERROR]: Log execution failed to start

Solution:
LDD tracking library file

[[email protected] bin]$ ldd libdmhs_exec.so
	linux-vdso.so.1 =>  (0x00007ffe819f6000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f3897ed8000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f3897bd5000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f38979cd000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f38977b1000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f38975ac000)
	libdmhs_pub.so => ./libdmhs_pub.so (0x00007f3897280000)
	libdmhs_ucvt.so => ./libdmhs_ucvt.so (0x00007f3896d25000)
	libdmhs_dm_obj.so => ./libdmhs_dm_obj.so (0x00007f3896b0f000)
	libdmhs_cvt.so => ./libdmhs_cvt.so (0x00007f3896886000)
	libdodbc.so => /opt/dmdbms/bin/libdodbc.so (0x00007f389665a000)
	/lib64/ld-linux-x86-64.so.2 (0x0000563b938c3000)
	libdmhs_exp.so => ./libdmhs_exp.so (0x00007f3896284000)
	libdmhs_xml.so => ./libdmhs_xml.so (0x00007f3896075000)
	libdmoci.so => not found
	libdmdpi.so => /opt/dmdbms/bin/libdmdpi.so (0x00007f3895406000)
	libdmfldr.so => /opt/dmdbms/bin/libdmfldr.so (0x00007f38947d5000)
	libdmelog.so => /opt/dmdbms/bin/libdmelog.so (0x00007f38945ce000)
	libdmutl.so => /opt/dmdbms/bin/libdmutl.so (0x00007f38943bc000)
	libdmclientlex.so => /opt/dmdbms/bin/libdmclientlex.so (0x00007f3894189000)
	libdmos.so => /opt/dmdbms/bin/libdmos.so (0x00007f3893f5c000)
	libdmcvt.so => /opt/dmdbms/bin/libdmcvt.so (0x00007f389387d000)
	libdmstrt.so => /opt/dmdbms/bin/libdmstrt.so (0x00007f3893669000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f3893360000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f389314a000)
	libdmmem.so => /opt/dmdbms/bin/libdmmem.so (0x00007f3892f3c000)
	libdmcalc.so => /opt/dmdbms/bin/libdmcalc.so (0x00007f3892cb7000)

Libdmoci.so not found

[[email protected] bin]$ pwd
/home/dmdba/dmhs/bin
[[email protected] bin]$ find -name libdmoci.so
./stat/libdmoci.so
[[email protected] bin]$ cat /home/dmdba/.bash_profile 
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/dmdbms/bin"
export DM_HOME="/opt/dmdbms"
export DMHS_HOME=/home/dmdba/dmhs
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dmdba/dmhs/bin
[[email protected] bin]$ cp ./stat/libdmoci.so ./

Find and find it in/home/dmdba/DMHS/bin/STAT/libdmoci.so, but LD_ LIBRARY_ Path is not specified in this directory. Copy libdmoci.so to LD_ LIBRARY_ Under the directory specified by path, or add LD_ LIBRARY_ The path points to/home/dmdba/DMHS/bin/STAT
(if find is not found, you need to download one online)

Try LDD it again

[[email protected] bin]$ ldd libdmhs_exec.so
	linux-vdso.so.1 =>  (0x00007ffcf27be000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f8c25479000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f8c25176000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f8c24f6e000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8c24d52000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f8c24b4d000)
	libdmhs_pub.so => ./libdmhs_pub.so (0x00007f8c24821000)
	libdmhs_ucvt.so => ./libdmhs_ucvt.so (0x00007f8c242c6000)
	libdmhs_dm_obj.so => ./libdmhs_dm_obj.so (0x00007f8c240b0000)
	libdmhs_cvt.so => ./libdmhs_cvt.so (0x00007f8c23e27000)
	libdodbc.so => /opt/dmdbms/bin/libdodbc.so (0x00007f8c23bfb000)
	/lib64/ld-linux-x86-64.so.2 (0x00005591fe1ef000)
	libdmhs_exp.so => ./libdmhs_exp.so (0x00007f8c23825000)
	libdmhs_xml.so => ./libdmhs_xml.so (0x00007f8c23616000)
	libdmoci.so => ./libdmoci.so (0x00007f8c22ba6000)
	libdmdpi.so => /opt/dmdbms/bin/libdmdpi.so (0x00007f8c21f38000)
	libdmfldr.so => /opt/dmdbms/bin/libdmfldr.so (0x00007f8c21307000)
	libdmelog.so => /opt/dmdbms/bin/libdmelog.so (0x00007f8c21100000)
	libdmutl.so => /opt/dmdbms/bin/libdmutl.so (0x00007f8c20eee000)
	libdmclientlex.so => /opt/dmdbms/bin/libdmclientlex.so (0x00007f8c20cbb000)
	libdmos.so => /opt/dmdbms/bin/libdmos.so (0x00007f8c20a8e000)
	libdmcvt.so => /opt/dmdbms/bin/libdmcvt.so (0x00007f8c203af000)
	libdmstrt.so => /opt/dmdbms/bin/libdmstrt.so (0x00007f8c2019b000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8c1fe92000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8c1fc7c000)
	libdmmem.so => /opt/dmdbms/bin/libdmmem.so (0x00007f8c1fa6e000)
	libdmcalc.so => /opt/dmdbms/bin/libdmcalc.so (0x00007f8c1f7e9000)

When it is normal, restart DMHS and try to start exec again

An error occurred during the signature verification in the ROS function pack warehouse

When we install the ros-related packages or perform sudo apt-get update on a linux system with ros installed, the following error will occur:

Get:1 http://packages.ros.org/ros/ubuntu focal InRelease [4,676 B]
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Err:1 http://packages.ros.org/ros/ubuntu focal InRelease
The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Fetched 4,676 B in 4s (1,078 B/s)
Reading package lists… Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/focal/InRelease The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics [email protected]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Why does this error occur?
ROS uses the debian package management system to distribute software, so it needs a GPG key to ensure the accuracy and authority of the package, usually the default key expires after about 2 years, so we need to add a new ros related key to it.

How to fix it
Download the certificate and add it.

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.key
sudo apt-key add ./ros.key

After the installation is successful, the log information of OK will be displayed.

$ sudo apt update
...
 Get:15 http://packages.ros.org/ros/ubuntu focal InRelease [4,676 B] 
...
 Fetched 2,671 kB in 2s (1,607 kB/s)                     
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 30 packages can be upgraded. Run 'apt list --upgradable' to see them.

About VMware: vmw_ ioctl_ Command error invalid argument. Solution

Development environment: windows10 + VMware + Ubuntu 18.04 + ROS

Run: gazebo

Prerequisites: installing gazebo:

sudo apt-get install ros-indigo-gazebo-ros-pkgs ros-indigo-gazebo-ros-control

Problem: run:

roscore
 rosrun gazebo_ros gazebo

appear

“VMware: vmw_ioctl_command error Invalid argument.
Aborted (core dumped)
/opt/ros/indigo/lib/gazebo_ros/gazebo: 39: kill: invalid signal number or name: SIGINT”

Set the environment variable to 0 under the terminal

$ export SVGA_VGPU10=0

Then you can run gazebo,

roscore
rosrun gazebo_ros gazebo 

Permanently available:

$ echo "export SVGA_VGPU10=0" >> ~/.bashrc