tork-a / visualization_rwt

visualization packages for rwt
BSD 3-Clause "New" or "Revised" License
51 stars 40 forks source link

Problem when using rwt_moveit #65

Open CRH380B-6216L opened 7 years ago

CRH380B-6216L commented 7 years ago

I am an ICT student and I am researching on a project controlling an industrial robot in a web browser. I found the "Visualization RWT" widgets on RobotWebTools website and use the rwt_moveit tool of it. However, I meet a problem when using this web tool on my industrial robot.

A Universal Robots UR5 robot and an Ubuntu 14.04 laptop with ROS Indigo are used for my project. I try to connect the web tool to the simulation of the robot:

$ roslaunch ur_gazebo ur5.launch
$ roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true
$ roslaunch rwt_moveit sim_demo.launch

The launch files of robot are avaliable in the package universal_robot.

Those things doesn't work well. All the parts of the robot are squeezed together at the centre of the scene: squeeze.png

And the terminal shows such error messages: errors.png

The tf frame in this situation (archived): frames.gv

UPDATE With the help of my colleagues I have fixed the problem on tf by setting the rwt_moveit's launch arg fixed_frame to /world.

For now the robot model shows correctly and the terminal no longer complaints. However the functionalities still don't work. The interactive markers float above the origin and terminal shows error when I move them:

[ERROR] [1510308383.570608252, 1423.895000000]: Variable '' is not known to model 'ur5'
Exception thrown.
[ERROR] [1510308383.570712721, 1423.895000000]: Exception thrown while processing service call: Variable '' is not known to model 'ur5'

screenshot from 2017-11-10 11 04 57 I wrote a launch file for my UR5 robot:

<launch>
    <include file="$(find ur_gazebo)/launch/ur5_joint_limited.launch" />
    <include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
        <arg name="sim" value="true" />
        <arg name="limited" value="true" />
    </include>
    <include file="$(find rwt_moveit)/launch/sim_demo.launch">
        <arg name="fixed_frame" value="/world" />
    </include>
</launch>

diff of basic.js (so a reference of ColladaLoader.js is to be added in index.html):

387,388c387
<                 rootObject : viewer.scene,
<                 loader : ROS3D.COLLADA_LOADER
---
>                 rootObject : viewer.scene
395,396c394
<                 rootObject : viewer.scene,
<                 loader : ROS3D.COLLADA_LOADER
---
>                 rootObject : viewer.scene
406,407c404
<                 rootObject : viewer.scene,
<                 loader : ROS3D.COLLADA_LOADER
---
>                 rootObject : viewer.scene

diff of index.html (the CDN of RobotWebTools is not working since this week, so I replaced the scripts with their local copy):

18,21c18,22
<             src="http://cdn.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<     <script type="text/javascript"
<             src="http://cdn.robotwebtools.org/roslibjs/current/roslib.js"></script>
<     <script type="text/javascript" src="http://cdn.robotwebtools.org/ros3djs/current/ros3d.js"></script>
---
>             src="ros3djs/ColladaLoader.js"></script>
>     <script type="text/javascript" src="ros3djs/STLLoader.js"></script>
>     <script type="text/javascript" src="ros3djs/eventemitter2.min.js"></script>
>     <script type="text/javascript" src="http://localhost:8000/rwt_moveit/js/roslib.js"></script>
>     <script type="text/javascript" src="http://localhost:8000/rwt_moveit/js/ros3d.js"></script>
k-okada commented 7 years ago

@CRH380B-6216L thank you for your investigation, I think we need https://github.com/tork-a/visualization_rwt/pull/66 for UR5 example, it also requires

rosrun tf static_transform_publisher 0 0 0 0 0 0 /world /start/world 100
rosrun tf static_transform_publisher 0 0 0 0 0 0 /world /goal/world 100

but not sure why we need this, I remember we can run this package without this in 'groovy/hydro' time.

BTW, I'm not familiar with javascript world, but do you think CDN will provide script for RobotWebTools near future? or should we provide from local file? And what browser are you using?

index.html (the CDN of RobotWebTools is not working since this week, so I replaced the scripts with their local copy):

CRH380B-6216L commented 7 years ago

@k-okada Thanks for your attention. I will validate the fixes soon.

The case is that the JavaScript CDNs provided by RobotWebTools (cdn.robotwebtools.org) is not working right now; accessing the script from there will return a 403 error. So that's the reason I replace them with local files. Besides, some of the dependencies are missing, so I also added them into tork-a/rwt_ros#20 and load them from that package. I am using Firefox in my project.

jihoonl commented 7 years ago

RWT CDN and demo server are currently experiencing hosting issue. I suggest to host them locally or directly from github for now. I will post in the mailing list as soon as I get some conclusion.

https://groups.google.com/d/msg/robot-web-tools/PlW1ECoL91Y/1ss6BPp_DAAJ

CRH380B-6216L commented 7 years ago

@k-okada I have tested with applying the changes at #66 in my rwt_moveit folder. It seems that the solution only fixed some problems. For now the UI, robots shows correctly and joints' slider works. But moving of the interactive markers does not apply to the state of (start/goal) robot, and planning & execution are not working.

The output when pressing Plan button (Python warning only shows at first time):

[ INFO] [1510578136.192191091, 43.464000000]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ WARN] [1510578136.193551765, 43.467000000]: No valid joint constraints
[ERROR] [1510578136.193646085, 43.467000000]: Unable to construct goal representation
/home/youbot-main/catkin_ws/src/visualization_rwt/rwt_moveit/nodes_bas/moveit_publisher.py:93: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  pub = rospy.Publisher('/update_joint_position', Float64MultiArray)
/home/youbot-main/catkin_ws/src/visualization_rwt/rwt_moveit/nodes_bas/moveit_publisher.py:94: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  stock_pub = rospy.Publisher('/stock_joint_position', Float64MultiArray)

The output when pressing Plan & Execute button:

[ INFO] [1510580598.148812149, 48.956000000]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ WARN] [1510580598.148893173, 48.956000000]: Execution of motions should always start at the robot's current state. Ignoring the state supplied as start state in the motion planning request
[ WARN] [1510580598.148940060, 48.956000000]: Execution of motions should always start at the robot's current state. Ignoring the state supplied as difference in the planning scene diff
[ INFO] [1510580598.149026881, 48.956000000]: Planning attempt 1 of at most 1
[ERROR] [1510580598.149103052, 48.956000000]: Found empty JointState message
[ERROR] [1510580598.149136747, 48.956000000]: Found empty JointState message
[ERROR] [1510580598.149223939, 48.956000000]: Found empty JointState message
[ERROR] [1510580598.149426641, 48.956000000]: Found empty JointState message
[ WARN] [1510580598.149559494, 48.956000000]: No valid joint constraints
[ERROR] [1510580598.149593562, 48.956000000]: Unable to construct goal representation

The output when moving any interactive marker:

[ERROR] [1510580636.527204987, 72.430000000]: No kinematics solver instantiated for group 'endeffector'

The output when checking/unchecking the checkbox of start/goal (errors come from browser):

TypeError: startState.add is not a function (2) basic.js:421:21
TypeError: start_im_client.hideIntMarker is not a function (2) basic.js:424:21
TypeError: goal_im_client.showIntMarker is not a function (2) basic.js:432:25
TypeError: goal_im_client.hideIntMarker is not a function (2) basic.js:437:21
k-okada commented 7 years ago

hi, did you change the bottom button from 'endeffector' to 'manipulator'?