Ask Your Question

joint_state_publisher: UnicodeEncodeError: 'ascii' codec can't encode character u'\u0130' in position 28396: ordinal not in range(128)

asked 2020-02-16 14:24:56 -0500

q8wwe gravatar image

updated 2020-02-17 03:20:35 -0500

gvdhoorn gravatar image

Robot : Eva Robot OS: ubuntu 16.04 /kinetic

I start working on a real-state robot. i was able to link the robot on my workstation and i can see all the topics on my work station. however, for visualizing the robot on rviz i can see all the joints links but not the wheels .wheels will be separated (i attached my TF tree). for launching my real-state robot I use launch file with the urdf and two nodes (robot_state_publisher , joint_state publisher ). joint state publisher alwayes give me the below error :

Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher", line 44, in <module>
    jsp = joint_state_publisher.JointStatePublisher()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/joint_state_publisher/", line 157, in __init__
    robot = xml.dom.minidom.parseString(description)
  File "/usr/lib/python2.7/xml/dom/", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", line 223, in parseString
    parser.Parse(string, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0130' in position 28396: ordinal not in range(128)
[joint_state_publisher-3] process has died [pid 7032, exit code 1, cmd /opt/ros/kinetic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher 
log file: /home/moh/.ros/log/638a2d20-50f6-11ea-8fb1-983b8fb9a8e3/joint_state_publisher-3*.log

My real state launch file:-

<?xml version="1.0"?>
  <arg name="robot_ns" default="/"/>
  <node pkg="robot_state_publisher" name="robot_state_publisher" type="state_publisher"/>
  <param name="robot_description" textfile="$(find evarobotmodel_description)/urdf/evarobotmodel.urdf"/>
  <param name="publish_frequency" type="double" value="10.0"/>
  <param name="tf_prefix" type="string" value="$(arg robot_ns)"/>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
    <param name="use_gui" type="bool" value="false"/>

My TF tree:-

C:\fakepath\tf .png

note: the previous Urdf works fine with gazebo . so I'm not sure if its URDf problem or joint _state _publisher issue.

kindly advise how to correctly see my robot in RVIZ and have the correct TF tree?

urdf file :

<?xml version="1.0" encoding="UTF-8"?>
<robot name="evarobotmodel">
  <link name="base_footprint">
      <origin xyz="0 0 0" rpy="0 0 0"/>
        <box size="0.001 0.001 0.001"/>
  <gazebo reference="base_footprint">
  <joint name="base_footprint_joint" type="fixed">
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <parent link="base_footprint"/>
    <child link="base_link"/>
  <!--BASE -->
  <link name="base_link">
      <origin xyz="0 0 0" rpy="0 0 0"/>
        <box size="0.4 0.3 0.3"/>
      <origin xyz="0.065 -0.11 -0.15" rpy="0 0 0"/>
        <mesh filename="package://evarobotmodel_description/meshes/base.dae"/>
      <material name="Gazebo/Black"/>
      <origin xyz="0 0 0" rpy="0 0 0 ...
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-02-16 19:30:23 -0500

robustify gravatar image

On line 975 of your URDF file, there is a unicode character in the comment that looks like this: <!-- İR1 -->

The "I" has a funny dot over it. Replace it with a real "I" and you should be good. I found this by pasting your URDF file in Notepad++ which lets you search for unicode characters and searched for \u0130, the unicode referenced in the error.

edit flag offensive delete link more


that's just a comment the compiler will ignore it .

q8wwe gravatar image q8wwe  ( 2020-02-17 08:58:42 -0500 )edit

A URDF file doesn't get compiled. At runtime, the joint state publisher runs it through the URDF parser to find all the joints for your robot. This parser can't handle unicode, and can only handle standard ASCII.

robustify gravatar image robustify  ( 2020-02-17 09:09:30 -0500 )edit

I tried to change the letter with dot , but that didn't solve joint_state_publisher issue

q8wwe gravatar image q8wwe  ( 2020-02-17 13:24:27 -0500 )edit

Are you getting the same error as before saying it is failing to parse \u0130?

robustify gravatar image robustify  ( 2020-02-17 13:38:14 -0500 )edit

I created new URDf by removing all parts ,I only kept tags related to base link and wheels . then i relaunched the previous real state launch file .

I got a better TF tree and I could visualize it with Rviz.

but now I'm facing new issue related to publish odom to base_link , i use robot_pose_ekf but it didn't work as when i run Rvis wheels will be separated and warning message will be displayed "No transform from [left_wheel_link] to [odom]".

q8wwe gravatar image q8wwe  ( 2020-02-17 15:23:02 -0500 )edit

That's a different issue entirely, so I recommend opening a new question for that. My guess is that the joint_state_publisher isn't communicating properly with the robot_state_publisher. Check an rqt_graph.

robustify gravatar image robustify  ( 2020-02-17 17:20:00 -0500 )edit

Thank you for the clarification .

I made new question on this link and attached : rqt,urdf, Rviz ,reastate launch file and odom_to_base.cpp

q8wwe gravatar image q8wwe  ( 2020-02-18 08:41:03 -0500 )edit

changing the letter removed that problem . thank you , many thanks to your precious help.

q8wwe gravatar image q8wwe  ( 2020-02-18 15:08:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-02-16 14:24:56 -0500

Seen: 65 times

Last updated: Feb 17