0
$\begingroup$

Rosanswers logo

I have installed ROS. I did the first two ROS/Tutorials (1. Installing and Configuring Your ROS Environment and 2. Navigating the ROS Filesystem) without problems. However, in the third (Creating a ROS Package) I have problem creating my package.

I do: $ cd ~/ros_workspace $ roscreate-pkg beginner_tutorials std_msgs rospy roscpp

and I get:

Created package directory /home/juliocesar/ros_workspace/beginner_tutorials
Created include directory  /home/juliocesar/ros_workspace/beginner_tutorials/include/beginner_tutorials
Created cpp source directory /home/juliocesar/ros_workspace/beginner_tutorials/src
Created package file /home/juliocesar/ros_workspace/beginner_tutorials/Makefile
Traceback (most recent call last):
  File "/opt/ros/electric/ros/bin/roscreate-pkg", line 35, in <module>
roscreate.roscreatepkg.roscreatepkg_main()
  File "/opt/ros/electric/ros/tools/roscreate/src/roscreate/roscreatepkg.py", line 126, in roscreatepkg_main
create_package(package, author_name(), depends, uses_roscpp=uses_roscpp, uses_rospy=uses_rospy)
  File "/opt/ros/electric/ros/tools/roscreate/src/roscreate/roscreatepkg.py", line 94, in create_package
f.write(contents)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 122: ordinal not in range(128)

It isn't like it must be, and the next commands don't work of course.

I don't know how to solve it...

Thanks.


Originally posted by jcgarciaca on ROS Answers with karma: 67 on 2012-04-16

Post score: 0


Original comments

Comment by CaptainTrunky on 2012-04-16:
I'm not very good in Python and rospackage, but can you try to do next?

  1. backup "/opt/ros/electric/ros/tools/roscreate/src/roscreate/roscreatepkg.py" :)

  2. change code in line 94, in create_package from

    f.write(contents)

to

f.write(contents.encode('utf8'))

Comment by joq on 2012-04-16:
What operating system and Python version are you using? Which ROS distribution?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I had the same problem. It turns out that I have a special character in my username that is being written to the manifest.xml, which is being created after the Makefile.

My simple solution is to remove that character from my username.


Originally posted by Karl Damkjær Hansen with karma: 139 on 2012-04-22

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.