ros-ukraine / leobot

LeoBot telepresence robot
MIT License
21 stars 4 forks source link

Add head teleoperation #62

Closed SystemDiagnosticss closed 6 years ago

SystemDiagnosticss commented 6 years ago

Add head teleoperation via webapp

Closes #52

AndriyPt commented 6 years ago

Warning during catkin_make_here of the project

WARNING: package "leobot_web_server" should not depend on metapackage "rosbridge_suite" but on its packages instead

Please fix it :)

AndriyPt commented 6 years ago

it is not good idea to copy javascript library directly to our code. Please consider adding file copy instruction to CMakeList.txt the same way as it was done here https://github.com/ros-ukraine/leobot/blob/kinetic-devel/leobot_web_server/CMakeLists.txt#L8-L13

MaxZhaloba commented 6 years ago

Hi, @AndriyPt

I've tried to implement the downloading and installation of roslib from npm, but with this approach the roslib.min.js for some reason is not copied to web_content/scripts when I run catkin_make _here. @SystemDiagnosticss suggested to ask advice from you to finish this issue sooner.

When I tried to experiment with the command configure_file the build failed, I could not find any related error messages in ~/workspace/leobot/base/build/CMakeFiles/CMakeError.log so I don't really know how to debug it.

So, I wanted to ask, can we use the configure_file command for copying or is it incorrect?

There's an option to use add_custom_command and regular cp just like with npm installation command. Igor has just told me that that you suggested this solution.

I've pushed the code to the branch F52.

MaxZhaloba commented 6 years ago

For the record, the command catkin_make -DCMAKE_BUILD_TYPE=Release didn't have any impact on configure_file instruction, i.e. the build finished successfully but the file wasn't copied.

MaxZhaloba commented 6 years ago

Just an update on this task. I've implemented this logic using standard cp but it there's an issue with order of execution of custom targets, when cp runs before npm i. In this way, when I delete the folder leobot_web_server/node_modules/roslib, catkin_make_here fails. I'm looking for possible solutions of this issue.

MaxZhaloba commented 6 years ago

The execution order of targets is fixed now :)

MaxZhaloba commented 6 years ago

@AndriyPt, Done

AndriyPt commented 6 years ago

Please also add /leobot_web_server/web_content/js/roslib.min.js to .gitignore file

MaxZhaloba commented 6 years ago

@AndriyPt, fixed.

AndriyPt commented 6 years ago

@MaxZhaloba @SystemDiagnosticss Red error message in logs.

[ERROR] [1520849841.532021, 8209.447000]: [Client 0] [id: subscribe:/leobot/head_position_controller/state:1] subscribe: Tried to register topic /leobot/head_position_controller/state with type std_msgs/Float64 but it is already established with type control_msgs/JointControllerState

Please careful and check logs. Especially warnings yellow and error red. Please note that error sometimes has [ERROR] label image

MaxZhaloba commented 6 years ago

@AndriyPt, thanks. Do we have any other roslib.min.js files in the project? If we do (or are going to have in the future) I think it makes sense to ignore all of them, since it's our policy not to include libraries into repository.

MaxZhaloba commented 6 years ago

Just a status update. I've changed the message type of head position listener to control_msgs/JointControllerState. I've added a log statement to print the received data to browser console, but I don't know how to interpret the data so far. Maybe the answer is relevant to this issue: https://answers.ros.org/question/48172/encoder-for-pr2-in-gazebo/

MaxZhaloba commented 6 years ago

@AndriyPt, I've just taken the process_value field as you've suggested. I overlooked it at first :) But when I investigated it myself, I could not find any good description of data fields in control_msgs/JointControllerState on the web. Can you recommend some source of information or documentation to look at when choosing an appropriate type of controller and interpreting its fields?

AndriyPt commented 6 years ago

@MaxZhaloba this is the best what I could find http://docs.ros.org/jade/api/control_msgs/html/msg/JointControllerState.html

AndriyPt commented 6 years ago

@MaxZhaloba please fix https://github.com/ros-ukraine/leobot/pull/62/files#r173745441

MaxZhaloba commented 6 years ago

@AndriyPt, thanks. I've seen that they provide some description of fields for other types of messages in this documentation, but unfortunately in this case we have what we have.

I've updated the branch.