Skip to content
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

Merged
merged 2 commits into from
Nov 5, 2016
Merged

Conversation

MPJansen
Copy link
Contributor

@MPJansen MPJansen commented Nov 3, 2016

Make sure python code is executable and note that in binary release of ROS, moveit_commander throws an exception while shutting down

Make sure python code is executable and note that in binary release of ROS, moveit_commander throws an exception while shutting down
Copy link
Member

@davetcoleman davetcoleman left a 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::
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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).
Copy link
Member

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?

Copy link
Contributor Author

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,

Copy link
Member

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.
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@davetcoleman
Copy link
Member

This is really great, thanks!

@davetcoleman davetcoleman merged commit 5284f93 into moveit:kinetic-devel Nov 5, 2016
BryceStevenWilley pushed a commit to BryceStevenWilley/moveit_tutorials that referenced this pull request May 5, 2018
* chomp updates
davetcoleman pushed a commit that referenced this pull request May 15, 2018
* chomp updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants