turtlebot3 icon indicating copy to clipboard operation
turtlebot3 copied to clipboard

Use turtlebot3 robots in a python3 environment

Open qiaoxianfeng opened this issue 3 years ago • 1 comments

ISSUE TEMPLATE ver. 0.4.0

  1. Which TurtleBot3 platform do you use?

    • [√ ] Burger
    • [ ] Waffle
    • [ ] Waffle Pi
  2. Which ROS is working with TurtleBot3?

    • [ ] ROS 1 Kinetic Kame
    • [√ ] ROS 1 Melodic Morenia
    • [ ] ROS 1 Noetic Ninjemys
    • [ ] ROS 2 Dashing Diademata
    • [ ] ROS 2 Eloquent Elusor
    • [ ] ROS 2 Foxy Fitzroy
    • [ ] etc (Please specify your ROS Version here)
  3. Which SBC(Single Board Computer) is working on TurtleBot3?

    • [ ] Intel Joule 570x
    • [ ] Raspberry Pi 3B+
    • [ ] Raspberry Pi 4
    • [√ ] etc (Please specify your SBC here)
  4. Which OS you installed on SBC?

    • [ ] Raspbian distributed by ROBOTIS
    • [ ] Ubuntu MATE (16.04/18.04/20.04)
    • [√ ] Ubuntu preinstalled server (18.04/20.04)
    • [ ] etc (Please specify your OS here)
  5. Which OS you installed on Remote PC?

    • [ ] Ubuntu 16.04 LTS (Xenial Xerus)
    • [√ ] Ubuntu 18.04 LTS (Bionic Beaver)
    • [ ] Ubuntu 20.04 LTS (Focal Fossa)
    • [ ] Windows 10
    • [ ] MAC OS X (Specify version)
    • [ ] etc (Please specify your OS here)
  6. Please describe the issue in detail. I wanted to use turtlebot3 robots in a python3 virtual environment, but I had the following problem.

Traceback (most recent call last): File "/opt/ros/melodic/lib/gazebo_ros/spawn_model", line 34, in from tf.transformations import quaternion_from_euler File "/home/qiao/python3_ws/devel/lib/python3/dist-packages/tf/init.py", line 34, in exec(__fh.read()) File "", line 30, in File "/home/qiao/python3_ws/devel/lib/python3/dist-packages/tf2_ros/init.py", line 34, in exec(__fh.read()) File "", line 38, in File "/home/qiao/python3_ws/devel/lib/python3/dist-packages/tf2_py/init.py", line 34, in exec(__fh.read()) File "", line 38, in ImportError: dynamic module does not define init function (init_tf2) [spawn_urdf-4] process has died [pid 7509, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -urdf -model turtlebot3_burger -x 0.0 -y 0.0 -z 0.0 -param robot_description __name:=spawn_urdf __log:=/home/qiao/.ros/log/dbe047f0-30ab-11ec-94ae-000c29f5bea9/spawn_urdf-4.log]. log file: /home/qiao/.ros/log/dbe047f0-30ab-11ec-94ae-000c29f5bea9/spawn_urdf-4*.log

Is there any way to make turtlebot3 run in python3?

qiaoxianfeng avatar Oct 19 '21 12:10 qiaoxianfeng

Hi @qiaoxianfeng

The ROS Melodic by default runs off of Python 2 and unfortunately, we do not provide support for customizing the default system. You may find more relevant information from ROS Answer community and other web pages something like below. https://www.miguelalonsojr.com/blog/robotics/ros/python3/2019/08/20/ros-melodic-python-3-build.html Thanks.

ROBOTIS-Will avatar Oct 25 '21 02:10 ROBOTIS-Will