Open aeksiri opened 6 years ago
try the following command
sudo pip2 install pyyaml
There should be a requirements.txt to install needed python libs for this repo.
Robot Blockly is currently being rewritten using the latest Google Blockly base, so this repo should only be used for research purposes.
Hi, I have the same problem. when looking at the code, it seems it is due a mix of python2 and python3 codes. ROS kinetic is powered by Pyhton 2 on my machine.
I am not sure that it is the best solution but it is a workaround that works for me.
Steps :
blockly_ws/src/turtlebot3_blockly/scripts/turtlebot3_blockly_backend.py
& blockly_ws/src/turtlebot3_blockly/scripts/pywebserver.py
sudo apt install ros-kinetic-mavros
Code that works for me:
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import socket
import os
from rospkg import RosPack
rp = RosPack()
frontend_path = rp.get_path('turtlebot3_blockly')
frontend_path += '/frontend'
print("Changing serve path to: " + frontend_path)
os.chdir(frontend_path)
HOST = socket.gethostname()
PORT = 1036
address = ("",PORT)
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(address, Handler)
print("serving at port", PORT)
httpd.serve_forever()
Hi, gdherbom.
I follow your instructions and got an error about "no module: crab_msgs.msg" in turtlebot3_blockly_backend.py
After comment those line about the "crab_msgs.msg" :
: It work!
Thanks a lot for your help.
Dear Sir/Madam
I have been tried install by follow the https://github.com/dabit-industries/turtlebot3_blockly
But, after catkin command is completed without any errors or warnings
Then, I've used bellow commands
$ source devel_isolated/turtlebot3_blockly/setup.bash $ roslaunch turtlebot3_blockly turtlebot3_blockly.launch
I've got this............
... logging to /home/denso/.ros/log/69490f4c-bbc4-11e8-9d1b-144f8adee130/roslaunch-denso-G7-19258.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://denso-G7:32819/
SUMMARY
PARAMETERS
NODES / turtlebot3_blockly_backend (turtlebot3_blockly/turtlebot3_blockly_backend.py) turtlebot3_blockly_webserver (turtlebot3_blockly/pywebserver.py)
auto-starting new master process[master]: started with pid [19268] ROS_MASTER_URI=http://localhost:11311
setting /run_id to 69490f4c-bbc4-11e8-9d1b-144f8adee130 process[rosout-1]: started with pid [19281] started core service [/rosout] process[turtlebot3_blockly_backend-2]: started with pid [19298] process[turtlebot3_blockly_webserver-3]: started with pid [19299] Traceback (most recent call last): File "/home/denso/blockly_ws/src/turtlebot3_blockly/scripts/turtlebot3_blockly_backend.py", line 35, in
import rospy
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/init.py", line 47, in
from std_msgs.msg import Header
File "/opt/ros/kinetic/lib/python2.7/dist-packages/std_msgs/msg/init.py", line 1, in
from ._Bool import
File "/opt/ros/kinetic/lib/python2.7/dist-packages/std_msgs/msg/_Bool.py", line 5, in
import genpy
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/init.py", line 34, in
from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/message.py", line 44, in
import yaml
ImportError: No module named 'yaml'
Traceback (most recent call last):
File "/home/denso/blockly_ws/src/turtlebot3_blockly/scripts/pywebserver.py", line 6, in
from rospkg import RosPack
ImportError: No module named 'rospkg'
[turtlebot3_blockly_backend-2] process has died [pid 19298, exit code 1, cmd /home/denso/blockly_ws/src/turtlebot3_blockly/scripts/turtlebot3_blockly_backend.py name:=turtlebot3_blockly_backend log:=/home/denso/.ros/log/69490f4c-bbc4-11e8-9d1b-144f8adee130/turtlebot3_blockly_backend-2.log].
log file: /home/denso/.ros/log/69490f4c-bbc4-11e8-9d1b-144f8adee130/turtlebot3_blockly_backend-2 .log
[turtlebot3_blockly_webserver-3] process has died [pid 19299, exit code 1, cmd /home/denso/blockly_ws/src/turtlebot3_blockly/scripts/pywebserver.py name:=turtlebot3_blockly_webserver log:=/home/denso/.ros/log/69490f4c-bbc4-11e8-9d1b-144f8adee130/turtlebot3_blockly_webserver-3.log].
log file: /home/denso/.ros/log/69490f4c-bbc4-11e8-9d1b-144f8adee130/turtlebot3_blockly_webserver-3*.log
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done