Tag Archives: ROS

[Solved] NameError: name ‘reload’ is not defined on ROS melody terminal

Solve in Ubuntu 18 After installing ROS melody under 04, the terminal appears NameError: name ‘reload’ is not defined

Method 1:

Comment out the melodic source in .bashrc, .zshrc, for example:

# source /opt/ros/melodic/setup.zsh

Method 2:

Comment out the code in /opt/ROS/melody/lib/python2.7/dist-packages/sitecustomize.py

#coding=utf8
#import sys
#reload(sys)
#sys.setdefaultencoding('utf8')

[Solved] AttributeError: ‘module‘ object has no attribute ‘CALIB_HAND_EYE_PARK‘

ubuntu18.04 ROS:melodic python2.7

 File "/home/bionic/yuxiangROS_handeye/catkin_ws/src/handeye-calib-master/src/handeye-calib/src/handeye/handeye_calibration_backend_opencv.py", line 29, in HandeyeCalibrationBackendOpenCV
    'Park': cv2.CALIB_HAND_EYE_PARK,
AttributeError: 'module' object has no attribute 'CALIB_HAND_EYE_PARK'
[base_hand_on_eye_calib-1] process has died [pid 15724, exit code 1, cmd /home/bionic/yuxiangROS_handeye/catkin_ws/src/handeye-calib-master/src/handeye-calib/src/handeye/base_hand_on_eye_calib.py __name:=base_hand_on_eye_calib __log:=/home/bionic/.ros/log/600b94f2-660e-11ec-93c4-94c691a2c1c1/base_hand_on_eye_calib-1.log].
log file: /home/bionic/.ros/log/600b94f2-660e-11ec-93c4-94c691a2c1c1/base_hand_on_eye_calib-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete

It should be the opencv version

I used the Q2 command and succeeded

Q1.pip install transforms3d
Q2.python -m pip install opencv-contrib-python, and then follow @yangbenbo 's advice, this problem is done(thank you).
Q3.after the two qusetion, Q3 is normal automaticaly.I just want to test the single node to debug(rqt_easy_handeye), thanks for your advice, it works.

[Solved] xacro: error: expected exactly one input file as argument

xacro: error: expected exactly one input file as argument RLException: Invalid tag: Cannot load command parameter [robot_description]: command ……
Param xml is <param command="$(find xacro)/xacro $(find rot_cararm)/urdf/robot_base
/base .urdf.xacro" name="robot_description"/>
The traceback for the exception was written to the log file

Reason: There is an extra space before “/base .urdf.xacro”
Can run after modification
File names with spaces cannot be used in the workspace path where the ROS function package is located

[Solved] fatal error: Eigen/Geometry: No such file or directory

Error encountered when compiling the program of Aubo manipulator. Eigen cannot be found

/opt/ros/melodic/include/moveit/robot_model/joint_model.h:47:10: fatal error: Eigen/Geometry: No such file or directory
#include <Eigen/Geometry>

Reason:
the location of eigin library is/usr/include/eigin3/eigen. The system cannot find this location. We need to link it manually

Solution:
manually create a soft link to the upper level directory

sudo ln -sf /usr/include eigen3/Eigen /usr/include/Eigen
sudo ln -sf /usr/include/eigen3/unsupported /usr/include/unsupported

[Solved] rqt_graph Skipped loading plugin with error & Format: “dot“ not recognized

rqt_graph run error:

[ERROR] [1637910144.803564743]: Skipped loading plugin with error: XML Document '/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml' has no Root Element. This likely means the XML is malformed or missing..
RosPluginProvider._parse_plugin_xml() plugin file "/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml" in package "rqt_virtual_joy" not found
RosPluginProvider._parse_plugin_xml() plugin file "/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml" in package "rqt_virtual_joy" not found
['dot', '-Tdot', '/tmp/tmpVMQLCN'] return code: 1
stdout, stderr:

Format: "dot" not recognized. Use one of:
Traceback (most recent call last):
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 289, in _refresh_rosgraph
self._update_graph_view(self._generate_dotcode())
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/ros_graph.py", line 324, in _generate_dotcode
hide_dynamic_reconfigure=hide_dynamic_reconfigure)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_graph/dotcode.py", line 914, in generate_dotcode
dotcode = dotcode_factory.create_dot(dotgraph)
File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_dotgraph/pydotfactory.py", line 175, in create_dot
dot = graph.create_dot()
File "/usr/lib/python2.7/dist-packages/pydot.py", line 1681, in <lambda>
self.create(format=f, prog=prog))
File "/usr/lib/python2.7/dist-packages/pydot.py", line 1900, in create
assert p.returncode == 0, p.returncode
AssertionError: 1
[1]    22100 abort (core dumped)  rqt_graph

The above message contains two errors.
One is that the plugin file is missing. Solution.
Create a new file plugin.xml in the /opt/ros/melodic/share/rqt_virtual_joy/ path and write the contents of the file.

<library path="src">
  <class name="My Plugin" type="rqt_virtual_joy.virtual_joy_module.MyPlugin" base_class_type="rqt_gui_py::Plugin">
    <description>
      An example Python GUI plugin to create a great user interface.
    </description>
    <qtgui>

      <group>
        <label>Robot Tools</label>
      </group>
      <!-- <group>
        <label>Subgroup</label>
      </group> -->

      <label>Virtual Joystick</label>
      <icon type="file">resource/input-gaming.png</icon>
      <statustip>Great user interface to provide real value.</statustip>
    </qtgui>
  </class>
</library>

Save and exit to fix problem 1;

The second problem is dot format recognition. Execute the command:

sudo dot -c

ROS package executes rosrun error: attributeerror: ‘thread’ object has no attribute ‘isalive‘

1.Error Messages:
joes@joes:~/jiao/Project/demo01_ws$ rosrun helloworld helloworld_p.py
[INFO] [1636100465.680519]: Hello World by python_____from Jiaozhidong
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py”, line 513, in _ros_atexit
signal_shutdown(‘atexit’)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py”, line 496, in signal_shutdown
if t.isAlive():
AttributeError: ‘Thread’ object has no attribute ‘isAlive’

II. Solution.
1. sudo gedit /opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py
(Fix it according to your own alarm path.)
2. Search for t.isAlive() in the alarm prompt
3. change t.isAlive() to t.is_alive()
Reason: python3 no longer supports isAlive function, need to update to is_alive format.

How to Solve Roscore Run error [Install ROS]

Command ‘roscore’ not found, but can be installed with:
sudo apt install python-roslaunch

Install Python Ross launch as prompted,

Error reporting: e: unable to correct problems, you have held broken packages

According to the online search, the binary executable named “roscore” may not exist in the folder “/opt/ROS/indigo/bin/”, and there will be no problem after having it

Solution:

1. First check whether there is a binary executable named roscore in the folder. If it does not exist, execute step 2. If it does exist, execute step 3

cd /opt/ros/melodic/bin
ls -l

2. If it does not exist, execute the following code, and then execute the first step to see if the roscore file exists. If it does, execute the third step

sudo apt-get install ros-melodic-desktop

3. If the roscore file is found in the first step, find the file named setup.sh under melody (the version of ROS you installed) and source its path

source /opt/ros/melodic/setup.sh

Enter roscore at the terminal, the problem is solved and the execution is successful.

Qxcbcconnection: xcb error: 148 error while ROS is running rviz

reason:

Because VNC is used to remotely control the lower computer, rviz is a graphics plug-in developed based on OpenGL. Theoretical screen parameters (the tis’ screen) need to be used. Using VNC will lead to incorrect screen parameter values, resulting in rviz errors.

resolvent:

1) Connect the display in the lower computer, and then turn on rviz on the PC enabled with VNC to temporarily solve the problem.

2) Use SSH instead of VNC to control the lower computer remotely. Pay attention to closing the VNC process running in the background, otherwise the core dump problem will occur when running rviz. In addition, due to the impact of network speed, there may be a stuck problem.

Running realsense ROS reports an error, USB cam overflow, hardware error

Run the command roslaunch realsense2_ camera rs_ The following error message appears in camera.launch:

resolvent:

The reason for this problem is not that the driver is not installed properly, but because the realsense is connected to the computer through the USB2.0 interface, the transmission speed is slow, resulting in data overflow and loss. The problem can be solved by connecting through USB3.0.