writing a controller plugin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

writing a controller plugin

baxelrod

Up until now, I have been using OpenRAVE with my robot in a very loose and non-integrated way.  Now I think I want some tighter integration to take better advantage of OpenRAVE’s features.  To do so, I believe I need to write a controller plugin, but am not sure how to get started.

 

I read these pages:

http://openrave.org/docs/latest_stable/coreapihtml/arch_controller.html

http://openrave.org/docs/latest_stable/coreapihtml/writing_plugins.html

 

and looked at this code:

src/cppexamples/ormulticontrol.cpp

src/cppexamples/plugincpp.cpp

plugins/basecontrollers/idealcontroller.cpp

plugins/basecontrollers/idealvelocitycontroller.cpp

 

but still have some questions:

Where in the controller do I actually send torque, velocity, and/or position commands to my robot hardware?  Does OR call the controller plugin at some rate?  Why does idealvelocitycontroller throw away the trajectory? 

 

Is there an example of a controller that controls *real* hardware I can look at?

 

Thanks,

Ben

 

Ben Axelrod

Sr. Robotics Software Engineer

iRobot Corporation

8 Crosby Drive, M/S 8-1

Bedford, MA 01730

(781) 430-3315

[hidden email]

 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: writing a controller plugin

GaTt
Hi Ben,

I wrote my own controller for my master thesis and found this post and the attached controller very usefull:
http://openrave-users-list.185357.n3.nabble.com/Re-Controller-Plugin-td185886.html

I will also try to answers your questions based on what I found out. (I did this via trial and error but it works pretty fine):
-Where in the controller do I actually send torque, velocity, and/or position commands to my robot hardware?
*I do this in the SimulationStep function, this function gets called by OR in a specific interval (I think it is 10ms), so i use this instead of a sending thread.
-Does OR call the controller plugin at some rate?
*As I know it always calls Init, IsDone and SimulationStep, if you use the MoveHandToPositionPose command, it also calls SetPath and Reset. It might also call the other public methods, but in my use cases it didn't.
-Why does idealvelocitycontroller throw away the trajectory?
*Unfortunately I didn't have a look at the idealvelocitycontroller so I can't give you an answer here.
-Is there an example of a controller that controls *real* hardware I can look at?
*As I mentioned in the beginning, I found the chaircontroller attached in Rosen's post very usefull and my implementation is inspired by this controller.

I hope this helps.
Greetings,
Clemens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: writing a controller plugin

Rosen Diankov
Administrator
Dear Ben,

That's a great idea and great question! The only thing open-source which I can point you to is back in 2009/2010 we wrote several controllers for the PA-10 and schunk arms:

http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/pa10controller/src/pa10controller.h

http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/schunk_motion_controllers/src/schunk_controller.h

you'll notice they use an OpenRAVEController defined at:

https://github.com/jsk-ros-pkg/openrave_planning/blob/master/openrave_robot_control/src/controllerclient.h

We did this back when doing everything in ROS was a fad, (because of the dynamic nature of ROS, it probably doesn't compile anymore), but it should give you the idea.

Inside the controller class we usually create a separate thread and do the real-time control in there. When SetPath gets called, it notifies the thread to send that trajectory next to the robot.
Using "SimulateStep" is dangerous since SimulateStep doesn't get called when simulation is turned off.

Unfortunately, beyond what Clemens sent, I don't have anything else open source to point you at. A lot of the robots we work with have proprietary APIs, which means we can't open source our openrave controller clients ;0/

Hope this helps,


2014-12-06 5:47 GMT+09:00 GaTt <[hidden email]>:
Hi Ben,

I wrote my own controller for my master thesis and found this post and the
attached controller very usefull:
http://openrave-users-list.185357.n3.nabble.com/Re-Controller-Plugin-td185886.html

I will also try to answers your questions based on what I found out. (I did
this via trial and error but it works pretty fine):
-Where in the controller do I actually send torque, velocity, and/or
position commands to my robot hardware?
*I do this in the SimulationStep function, this function gets called by OR
in a specific interval (I think it is 10ms), so i use this instead of a
sending thread.
-Does OR call the controller plugin at some rate?
*As I know it always calls Init, IsDone and SimulationStep, if you use the
MoveHandToPositionPose command, it also calls SetPath and Reset. It might
also call the other public methods, but in my use cases it didn't.
-Why does idealvelocitycontroller throw away the trajectory?
*Unfortunately I didn't have a look at the idealvelocitycontroller so I
can't give you an answer here.
-Is there an example of a controller that controls *real* hardware I can
look at?
*As I mentioned in the beginning, I found the chaircontroller attached in
Rosen's post very usefull and my implementation is inspired by this
controller.

I hope this helps.
Greetings,
Clemens



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/writing-a-controller-plugin-tp4027175p4027176.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: writing a controller plugin

baxelrod

Thank you both.  I’ll start digging into this soon.

-Ben

 

From: Rosen Diankov [mailto:[hidden email]]
Sent: Tuesday, December 09, 2014 12:28 AM
To: GaTt
Cc: [hidden email]
Subject: Re: [OpenRAVE-users] writing a controller plugin

 

Dear Ben,

That's a great idea and great question! The only thing open-source which I can point you to is back in 2009/2010 we wrote several controllers for the PA-10 and schunk arms:

http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/pa10controller/src/pa10controller.h

http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/schunk_motion_controllers/src/schunk_controller.h

you'll notice they use an OpenRAVEController defined at:

https://github.com/jsk-ros-pkg/openrave_planning/blob/master/openrave_robot_control/src/controllerclient.h

We did this back when doing everything in ROS was a fad, (because of the dynamic nature of ROS, it probably doesn't compile anymore), but it should give you the idea.

Inside the controller class we usually create a separate thread and do the real-time control in there. When SetPath gets called, it notifies the thread to send that trajectory next to the robot.
Using "SimulateStep" is dangerous since SimulateStep doesn't get called when simulation is turned off.

Unfortunately, beyond what Clemens sent, I don't have anything else open source to point you at. A lot of the robots we work with have proprietary APIs, which means we can't open source our openrave controller clients ;0/

Hope this helps,

 

2014-12-06 5:47 GMT+09:00 GaTt <[hidden email]>:

Hi Ben,

I wrote my own controller for my master thesis and found this post and the
attached controller very usefull:
http://openrave-users-list.185357.n3.nabble.com/Re-Controller-Plugin-td185886.html

I will also try to answers your questions based on what I found out. (I did
this via trial and error but it works pretty fine):
-Where in the controller do I actually send torque, velocity, and/or
position commands to my robot hardware?
*I do this in the SimulationStep function, this function gets called by OR
in a specific interval (I think it is 10ms), so i use this instead of a
sending thread.
-Does OR call the controller plugin at some rate?
*As I know it always calls Init, IsDone and SimulationStep, if you use the
MoveHandToPositionPose command, it also calls SetPath and Reset. It might
also call the other public methods, but in my use cases it didn't.
-Why does idealvelocitycontroller throw away the trajectory?
*Unfortunately I didn't have a look at the idealvelocitycontroller so I
can't give you an answer here.
-Is there an example of a controller that controls *real* hardware I can
look at?
*As I mentioned in the beginning, I found the chaircontroller attached in
Rosen's post very usefull and my implementation is inspired by this
controller.

I hope this helps.
Greetings,
Clemens



--
View this message in context: http://openrave-users-list.185357.n3.nabble.com/writing-a-controller-plugin-tp4027175p4027176.html
Sent from the OpenRAVE Users List mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users

 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: writing a controller plugin

Michael Koval
It may be too late, but here is another example:

https://github.com/personalrobotics/or_owd_controller

This is an OpenRAVE controller plugin that communicates with the
OpenWAM driver (OWD) via ROS. Do note that there is a fair amount of
OWD-specific code in there (e.g. ExecuteTimedTrajectory, execution
flags) that does not apply to most controllers.

-Mike

On Tue, Dec 9, 2014 at 9:23 AM, Axelrod, Ben <[hidden email]> wrote:

> Thank you both.  I’ll start digging into this soon.
>
> -Ben
>
>
>
> From: Rosen Diankov [mailto:[hidden email]]
> Sent: Tuesday, December 09, 2014 12:28 AM
> To: GaTt
> Cc: [hidden email]
> Subject: Re: [OpenRAVE-users] writing a controller plugin
>
>
>
> Dear Ben,
>
> That's a great idea and great question! The only thing open-source which I
> can point you to is back in 2009/2010 we wrote several controllers for the
> PA-10 and schunk arms:
>
> http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/pa10controller/src/pa10controller.h
>
> http://sourceforge.net/p/cmu-ros-pkg/code/HEAD/tree/trunk/schunk_motion_controllers/src/schunk_controller.h
>
> you'll notice they use an OpenRAVEController defined at:
>
> https://github.com/jsk-ros-pkg/openrave_planning/blob/master/openrave_robot_control/src/controllerclient.h
>
> We did this back when doing everything in ROS was a fad, (because of the
> dynamic nature of ROS, it probably doesn't compile anymore), but it should
> give you the idea.
>
> Inside the controller class we usually create a separate thread and do the
> real-time control in there. When SetPath gets called, it notifies the thread
> to send that trajectory next to the robot.
> Using "SimulateStep" is dangerous since SimulateStep doesn't get called when
> simulation is turned off.
>
> Unfortunately, beyond what Clemens sent, I don't have anything else open
> source to point you at. A lot of the robots we work with have proprietary
> APIs, which means we can't open source our openrave controller clients ;0/
>
> Hope this helps,
>
>
>
> 2014-12-06 5:47 GMT+09:00 GaTt <[hidden email]>:
>
> Hi Ben,
>
> I wrote my own controller for my master thesis and found this post and the
> attached controller very usefull:
> http://openrave-users-list.185357.n3.nabble.com/Re-Controller-Plugin-td185886.html
>
> I will also try to answers your questions based on what I found out. (I did
> this via trial and error but it works pretty fine):
> -Where in the controller do I actually send torque, velocity, and/or
> position commands to my robot hardware?
> *I do this in the SimulationStep function, this function gets called by OR
> in a specific interval (I think it is 10ms), so i use this instead of a
> sending thread.
> -Does OR call the controller plugin at some rate?
> *As I know it always calls Init, IsDone and SimulationStep, if you use the
> MoveHandToPositionPose command, it also calls SetPath and Reset. It might
> also call the other public methods, but in my use cases it didn't.
> -Why does idealvelocitycontroller throw away the trajectory?
> *Unfortunately I didn't have a look at the idealvelocitycontroller so I
> can't give you an answer here.
> -Is there an example of a controller that controls *real* hardware I can
> look at?
> *As I mentioned in the beginning, I found the chaircontroller attached in
> Rosen's post very usefull and my implementation is inspired by this
> controller.
>
> I hope this helps.
> Greetings,
> Clemens
>
>
>
> --
> View this message in context:
> http://openrave-users-list.185357.n3.nabble.com/writing-a-controller-plugin-tp4027175p4027176.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Loading...