-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add steps to run python code #47
Conversation
Make sure python code is executable and note that in binary release of ROS, moveit_commander throws an exception while shutting down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for creating this PR! A few small changes.
|
||
rosrun moveit_tutorials move_group_python_interface_tutorial.py | ||
|
||
Or roslaunch the launch file to run the code directly from moveit_tutorials:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the roslaunch file and instead make the instructions simply say A) run roslaunch pr2_moveit_config demo.launch
then B) run rosrun moveit_tutorials move_group_python_interface_tutorial.py
? Similar to the tutorial I just modified for C++ here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've adjusted accordingly. However, now the process of launching a python node via a launch file is no longer part of the tutorial, Which makes it subtly different from the c++ tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as #45 is merged it will match the C++ MoveGroupInterface tutorial!
on github. All the code in this tutorial can be run from the | ||
moveit_tutorials package that you have as part of your MoveIt! setup. | ||
|
||
Running the code | ||
^^^^^^^^^^^^^^^^ | ||
|
||
Roslaunch the launch file to run the code directly from moveit_tutorials:: | ||
Make sure your python file is executable (chmod +x scripts/move_group_python_interface_tutorial.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why chmod
is needed here? Seems unusual for a ROS node - is it just your computer's setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that when a shell runs a file its properties need to be set to executable for the shell to actually execute the file, together with the shebang line ( #!/usr/bin/env python ) causes the python file to be executed as a python script when it is run in the shell (How this interacts with rosrun, I do not know)
To be honest I do not know if it is strictly necessary but I followed this tutorial, which mentions the step: [http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber(python)]
I might try to see if it can go without tonight,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. would the file path be more clear if it was:
roscd moveit_tutorials/doc/pr2_tutorials/planning/scripts/
chmod +x move_group_python_interface_tutorial.py
?
|
||
roslaunch moveit_tutorials move_group_python_interface_tutorial.launch | ||
|
||
Please note that due to a bug discussed in issue `#15 <https://github.com/ros-planning/moveit_commander/issues/15>`_ the moveit_commander throws an exception when shutting down. | ||
This does not interfere with the functioning of the code itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify here that this is a bug for the Indigo release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
changes to rosrun and chmod
This is really great, thanks! |
* chomp updates
Make sure python code is executable and note that in binary release of ROS, moveit_commander throws an exception while shutting down