|
|
Line 1: |
Line 1: |
− | == Using OpenRAVE over the ROS Network ==
| |
| | | |
− | [http://www.ros.org/browse/details.php?name=openraveros openraveros] is one way for you to start the openrave-core and simultaneously get it to advertise several ROS services that can control that openrave instance. Inside the octave folder are functions similar to the default Octave interface provided by openrave. You can use these functions to control openrave over ROS.
| |
− |
| |
− | In order to use the octave functions, you have to add '''`rospack find openraveros`/octave''' to the octave path. This can be done simply in octave by calling
| |
− |
| |
− | <source lang="matlab">
| |
− | [status,rosoctpath] = system('rospack find openraveros');
| |
− | rosoctpath = strtrim(rosoctpath);
| |
− | addpath(fullfile(rosoctpath,'octave'));
| |
− | </source>
| |
− |
| |
− | There's an option to view both the convex decomposition and real meshes simultaneously (menu View->Geometry->Render/Collision).
| |
− |
| |
− | == Getting Started ==
| |
− | There are several launch files to perform common tasks and configure the environment:
| |
− |
| |
− | * startopenraveros.ros.xml - Starts the openraveros server with all the correct paths set for resource files and plugins
| |
− |
| |
− | === Octave ===
| |
− |
| |
− | Please include the `rospack find openraveros`/octave in your OCTAVEPATH. First start a server:
| |
− | rosrun openraveros openraveros
| |
− |
| |
− | Note that this creates many services and the all important '''openrave_session''' service that allows octave clients to create sessions. In order to start a '''session''' on an openraveros server from octave, use the following:
| |
− |
| |
− | <source lang="matlab">
| |
− | openraverospath = rosoct_findpackage('openraveros');
| |
− | if( ~isempty(openraverospath) )
| |
− | addpath(fullfile(openraverospath,'octave'));
| |
− | end
| |
− |
| |
− | viewer = 'qtcoin'; % optional, can be '' to set no viewer
| |
− | openraveros_restart('openrave_session',viewer,1);
| |
− | orEnvSetOptions('wdims 800 600'); % if a viewer is set, use a 800x600 window size
| |
− | orEnvSetOptions('simulation timestep 0.001');
| |
− | </source>
| |
− |
| |
− |
| |
− | The functions prefixed with '''or''' are equivalent to the openrave functions that come with the official openrave repository, except they communicate through ROS rather than custom network messages.
| |
− |
| |
− | The functions prefixed with '''openraveros_''' allow configuration of what session is currently being used. New remote sessions can be started from any specified topic, this allows any number of openraveros servers to be controlled simultaneously. The openraveros servers have to be started in their own namespaces in order to keep the services from conflicting:
| |
− | ROS_NAMESPACE=myspace rosrun openraveros openraveros
| |
− |
| |
− | You would now start the session on the octave client using:
| |
− | openraveros_restart('myspace/openrave_session',viewer,1);
| |
− |
| |
− | Please look at the '''help''' file for every function.
| |