Create a subscriber in Move Group Python Interface to keep getting desired poses to plan and execute
My purpose: In the Move Group Python Interface section in the Moveit it tutorials(kinetic version), it shows we can plan a motion for a move group to a desired pose for the end-effector and excute it as shown is the snippet of code below: pose_goal = geometry_msgs.msg.Pose() pose_goal.orientation.w = 1.0 pose_goal.position.x = 0.4 pose_goal.position.y = 0.1 pose_goal.position.z = 0.4 group.set_pose_target(pose_goal)
In this example code available on moveit site, however, we can only plan one pose (instead of a number of successive poses which can form a smooth line) at a time. So I've got an idea that I could augmented this piece of code with a subscriber which listens to a ROS sensor sending poses to move group in this code then plan and execute those desired pose. Ideally, in this way, I can perform a smooth trajectory with all the poses together.
My first question is whether what I am planning to do feasible and practical?
If so, I've got some other questions while working on it. I am using a leap motion sensor as a publisher (publishing hand positions) in the ROS structure. As I said I would build a subscriber in the Move Group Python Interface code to keep receiving new poses then plan and execute in time. To get the job done: First,I created a package named leap_moveit with the following depedencies: catkin_create_pkg leap_moveit rospy rospack moveit_commander moveit_msgs geometry_msgs
Secondly,I put the modified Move Group Python Interface code(the main difference is there is a subscriber to obtain new desired poses in this code). The subscriber is: leap_sub = rospy.Subscriber('leapmotion/data', leapros, go_to_joint_state)
Thirdly,I updated CMakeLists.txt and package.xml accordingly and created a launch file in the launch directory of my leap_moveit pkg.
Finally, when I run roslaunch leap_moveit leapmoveit.launch to try out the code, I throws the following errors. Can anyone help?
mario@mario:~$ roslaunch leap_moveit leapmoveit.launch
... logging to /home/mario/.ros/log/fa712ea8-1ab7-11e9-a98a-94c6911255ab/roslaunch-mario-30026.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/mario/.ros/log] is over 1GB.
It's recommended that you use the 'rosclean' command.
started roslaunch server http://localhost:32869/
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
/
leapmoveit_node (leap_moveit/move_group_python_interface_leap.py)
auto-starting new master
process[master]: started with pid [30043]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to fa712ea8-1ab7-11e9-a98a-94c6911255ab
process[rosout-1]: started with pid [30063]
started core service [/rosout]
process[leapmoveit_node-2]: started with pid [30069]
Failed to import pyassimp, see https://github.com/ros-planning/moveit/issues/86 for more info
[ERROR] [1547771310.996982652]: Robot model parameter not found! Did you remap 'robot_description'?
Traceback (most recent call last):
File "/home/mario/catkin_ws/src/leap_moveit/src/move_
group_python_interface_leap.py", line 223, in <module>
main()
File "/home/mario/catkin_ws/src/leap_moveit/src/move_group_python_interface_leap.py", line 202, in main
tutorial = MoveGroupPythonIntefaceTutorial()
File "/home/mario/catkin_ws/src/leap_moveit/src/move_group_python_interface_leap ...
Can you please update your question with all of the comments removed? Your code is unnecessarily long with them in and difficult to read
Hi buddy, updated. Basically, what I've done is I added a subscriber in the Move Group Python Interface example code.
But it doesn't work as expected. Is my idea of creating a subscriber wrong? Can you do me a favour?
hi did yo succeed in Create a subscriber and executing a continuous path?