[Solved] /opt/husarion/tools/rpi-linux went missing

When i tried to run /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2, i got the following error

[INFO] [1574820128.513797]: ROS Serial Python Node
[INFO] [1574820128.528136]: Connecting to /dev/ttyCORE2 at 500000 baud
[INFO] [1574820130.701011]: Note: publish buffer size is 512 bytes
[INFO] [1574820130.702270]: Setup publisher on /battery [sensor_msgs/BatteryState]
[INFO] [1574820130.709184]: Setup publisher on /pose [geometry_msgs/PoseStamped]
[INFO] [1574820130.716263]: Setup publisher on /joint_states [sensor_msgs/JointState]
[ERROR] [1574820131.095345]: Cannot import package : tf
[ERROR] [1574820131.096446]: sys.path was ['/opt/husarion/tools/rpi-linux', '/home/husarion/ros_workspace/devel/lib/python2.7/dist-packages', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']
[ERROR] [1574820131.097414]: Creation of publisher failed: 'NoneType' object has no attribute 'msg'
[INFO] [1574820131.105733]: Note: subscribe buffer size is 512 bytes
[INFO] [1574820131.106704]: Setup subscriber on /cmd_vel [geometry_msgs/Twist]
[INFO] [1574820131.117414]: Setup subscriber on /reset_odom [std_msgs/Bool]
[ERROR] [1574820131.121083]: Tried to publish before configured, topic id 128

Then i check, sys.path in python and found this

[’’, ‘/home/husarion/ros_workspace/devel/lib/python2.7/dist-packages’, ‘/opt/ros/kinetic/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-arm-linux-gnueabihf’, ‘/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages/PILcompat’, ‘/usr/lib/python2.7/dist-packages/gtk-2.0’, ‘/usr/lib/python2.7/dist-packages/wx-3.0-gtk2’]

'/opt/husarion/tools/rpi-linux' went missing from the system path. How to add it back?

Please help. Thanks for your time.

Hello aiubian,

Answering your question, to add value to path, you should do:

export PATH=_path_to_be_added_:$PATH

For adding /opt/husarion/tools/rpi-linux it will be:

export PATH=/opt/husarion/tools/rpi-linux:$PATH

But this is not the issue, as the error is about missing ROS package.
Did you change anything in system configuration or firmware?

Regards,
Łukasz

Hi,

I tried to install GitHub - yzqin/rgbdslam: A RGB-D SLAM package for astra camera in rosbot in order to create slam using camera. But this didn’t work. After that, settings got change. How to restore previous setting? is there any way to do that?

Thanks.

Hello aiubian,

It could be difficult to determine what changes were introduced during installation, but I would make sure that below packages are installed:

ros-kinetic-tf2-msgs ros-kinetic-tf2-geometry-msgs ros-kinetic-move-base-msgs ros-kinetic-nav-msgs ros-kinetic-sensor-msgs ros-kinetic-geometry-msgs ros-kinetic-rosbridge-msgs  ros-kinetic-rqt-tf-tree ros-kinetic-tf ros-kinetic-tf-conversions ros-kinetic-tf2 ros-kinetic-tf2-eigen ros-kinetic-tf2-kdl ros-kinetic-tf2-py ros-kinetic-tf2-ros

Then remove rgbdslam from your workspace, or create new workspace:

mkdir -p ~/new_workspace/src
cd ~/new_workspace/src
catkin_init_workspace
cd ~/new_workspace
catkin_make

Check if in .bashrc at the end of file there are lines:

source /opt/ros/kinetic/setup.sh
source ~/new_workspace/devel/setup.sh

and there should be no entries pointing to other workspaces.

Try again to start:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2

Regards,
Łukasz

Hi,

I have created new workspace.

husarion@husarion:~$ echo $ROS_PACKAGE_PATH
/home/husarion/anik_workspace/src:/opt/ros/kinetic/share

but still giving the same error

husarion@husarion:~$ /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2
[INFO] [1575945842.473013]: ROS Serial Python Node
[INFO] [1575945842.487338]: Connecting to /dev/ttyCORE2 at 500000 baud
[INFO] [1575945844.693603]: Note: publish buffer size is 512 bytes
[INFO] [1575945844.695087]: Setup publisher on /battery [sensor_msgs/BatteryState]
[INFO] [1575945844.703716]: Setup publisher on /pose [geometry_msgs/PoseStamped]
[INFO] [1575945844.711768]: Setup publisher on /joint_states [sensor_msgs/JointState]
[ERROR] [1575945845.219397]: Cannot import package : tf
[ERROR] [1575945845.221056]: sys.path was [’/opt/husarion/tools/rpi-linux’, ‘/opt/ros/kinetic/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-arm-linux-gnueabihf’, ‘/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages/PILcompat’, ‘/usr/lib/python2.7/dist-packages/gtk-2.0’, ‘/usr/lib/python2.7/dist-packages/wx-3.0-gtk2’]
[ERROR] [1575945845.222695]: Creation of publisher failed: ‘NoneType’ object has no attribute ‘msg’
[INFO] [1575945845.234875]: Note: subscribe buffer size is 512 bytes
[INFO] [1575945845.236294]: Setup subscriber on /cmd_vel [geometry_msgs/Twist]
[INFO] [1575945845.252721]: Setup subscriber on /reset_odom [std_msgs/Bool]
[ERROR] [1575945845.257964]: Tried to publish before configured, topic id 128

and sys.path

>>> sys.path 
['', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']

Please help. Thanks.

Could you provide also output of:
1.

env | grep PYTHON
python --version

Regards,
Łukasz

hi,

here it is

husarion@husarion:~$ env | grep PYTHON
PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages

and

husarion@husarion:~$ python --version
Python 2.7.12

Thanks.

We will also check if tf is on list of installed packages.
First install pip if it is not yet installed:

sudo apt-get install python-pip

Then list all python packages:

pip freeze

One of the lines should contain:

tf==_version_number_

Please provide here full output of pip freeze command.

Regards,
Łukasz

Hi,

Here it is

pip freeze
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
actionlib==1.11.13
angles==1.9.11
attrs==15.2.0
autobahn==0.10.3
backports.ssl-match-hostname==3.4.0.2
camera-calibration-parsers==1.11.13
catkin==0.7.18
catkin-pkg==0.4.14
catkin-pkg-modules==0.4.14
catkin-tools==0.4.5
chardet==2.3.0
controller-manager==0.13.3
controller-manager-msgs==0.13.3
cryptography==1.2.3
cv-bridge==1.12.8
defusedxml==0.4.1
deluge==1.3.12
diagnostic-updater==1.9.3
docutils==0.12
dynamic-reconfigure==1.5.50
ecdsa==0.13
empy==3.3.2
enum34==1.1.2
futures==3.0.5
gazebo-ros==2.5.19
gencpp==0.6.0
geneus==2.2.6
genlisp==0.4.16
genmsg==0.5.11
gennodejs==2.0.1
genpy==0.6.7
idna==2.0
interactive-markers==1.11.4
ipaddress==1.0.16
laser-geometry==1.6.4
lz4==0.7.0
message-filters==1.12.14
mpi4py==1.3.1
msgpack-python==0.4.6
netifaces==0.10.4
nose==1.3.7
numpy==1.11.0
osrf-pycommon==0.1.8
PAM==0.4.2
paramiko==1.16.0
Pillow==3.1.2
pluginlib==1.11.3
pyasn1==0.1.9
pyasn1-modules==0.0.7
pycrypto==2.6.1
pycurl==7.43.0
pydot==1.0.29
pygame===1.9.1release
Pygments==2.1
pygobject==3.20.0
PyMySQL==0.7.2
pyOpenSSL==0.15.1
pyparsing==2.0.3
pyserial==3.0.1
Pyste==0.9.10
python-dateutil==2.4.2
python-libtorrent==1.0.7
python-qt-binding==0.3.4
python-snappy==0.5
pyxdg==0.25
PyYAML==3.11
qt-dotgraph==0.3.11
qt-gui==0.3.11
qt-gui-cpp==0.3.11
resource-retriever==1.12.5
roman==2.0.0
rosapi==0.11.3
rosbag==1.12.14
rosbridge-library==0.11.3
rosbridge-server==0.11.3
rosclean==1.14.6
rosdep==0.17.1
rosdistro==0.7.5
rosdistro-modules==0.7.5
rosgraph==1.12.14
roslaunch==1.12.14
roslib==1.14.6
roslz4==1.12.14
rosmaster==1.12.14
rosmsg==1.12.14
rosnode==1.12.14
rosparam==1.12.14
rospkg==1.2.0
rospkg-modules==1.2.0
rospy==1.12.14
rosserial-client==0.7.7
rosserial-python==0.7.7
rosservice==1.12.14
rostest==1.12.14
rostopic==1.12.14
rosunit==1.14.6
roswtf==1.12.14
rqt-graph==0.4.9
rqt-gui==0.5.0
rqt-gui-py==0.5.0
rviz==1.12.17
sensor-msgs==1.12.7
service-identity==16.0.0
six==1.10.0
smclib==1.8.3
tf==1.11.9
tf2-kdl==0.5.20
tf2-py==0.5.20
tf2-ros==0.5.20
topic-tools==1.12.14
tornado==4.2.1
trollius==2.0.1
Twisted==16.0.0
txaio==1.0.0
wxPython==3.0.2.0
wxPython-common==3.0.2.0
xacro==1.11.3
zope.interface==4.1.3

Hello aiubian,

None of the outputs you provided indicate errors which could prevent /opt/husarion/tools/rpi-linux/ros-core2-client from running.
Problem is probably caused by some other factor, which would be difficult to track down.
In this case, the easiest solution will be to flash clean image.

Regards,
Łukasz

Hi Łukasz,

I have reinstalled the image of ROSbot. Now, it is working fine.

Thanks for your time.