public class CentralizedPeriodicActionPub extends Object implements ActionPublisher
ActionPublisher that flips the message being sent periodically by a PeriodicPublisher.
This is useful when you want a ROS message constantly published to a topic and want BURLAP actions to merely change what message
will be published in the future. For example, You might want to constantly publish a geometry_msgs/Twist message to robot
to define how its moving with the execution of different BURLAP actions canceling the previous movement directive for a new one.
Note that the provided PeriodicPublisher must have been started externally first with its
PeriodicPublisher.beginPublishing(int) or PeriodicPublisher.beginPublishing(Object, int) method.
If it has not been started then when this object gets a publish message, it will change the PeriodicPublisher message
to send, but it will never be sent because it hasn't been started.ActionPublisher.DirectActionPublisher| Modifier and Type | Field and Description |
|---|---|
protected Object |
msg
The ROS message to which the provided
PeriodicPublisher will be flipped when this objects publishAction(Action) method is called. |
protected ros.tools.PeriodicPublisher |
ppub
The
PeriodicPublisher whose message will be altered by this ActionPublisher. |
protected int |
timeDelay
The time delay returned by the
publishAction(Action) method. |
| Constructor and Description |
|---|
CentralizedPeriodicActionPub(ros.tools.PeriodicPublisher ppub,
Object msg,
int timeDelay)
Initializes
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getMsg()
Returns the ROS message that the this object has periodically published
|
ros.tools.PeriodicPublisher |
getPpub()
Returns the
PeriodicPublisher that has its message altered by this object. |
int |
getTimeDelay()
Returns the time delay in milliseconds returned by the
publishAction(Action) method |
int |
publishAction(burlap.mdp.core.action.Action a)
Takes a BURLAP
Action turns into a ROS message, and publishes it to ROS through this
object's ROS Bridge Publisher object. |
void |
setMsg(Object msg)
Sets the ROS message that the this object has periodically published
|
void |
setPpub(ros.tools.PeriodicPublisher ppub)
Sets the
PeriodicPublisher that has its message altered by this object. |
void |
setTimeDelay(int timeDelay)
Sets the time delay in milliseconds returned by the
publishAction(Action) method |
protected ros.tools.PeriodicPublisher ppub
PeriodicPublisher whose message will be altered by this ActionPublisher.protected Object msg
PeriodicPublisher will be flipped when this objects publishAction(Action) method is called.protected int timeDelay
publishAction(Action) method.public CentralizedPeriodicActionPub(ros.tools.PeriodicPublisher ppub,
Object msg,
int timeDelay)
ppub - the PeriodicPublisher whose message will be altered by this ActionPublisher.msg - the ROS message to which the provided PeriodicPublisher will be flipped when this objects publishAction(Action) method is called.timeDelay - the time delay returned by the publishAction(Action) method.public ros.tools.PeriodicPublisher getPpub()
PeriodicPublisher that has its message altered by this object.PeriodicPublisher that has its message altered by this object.public void setPpub(ros.tools.PeriodicPublisher ppub)
PeriodicPublisher that has its message altered by this object.ppub - the PeriodicPublisher that has its message altered by this object.public Object getMsg()
public void setMsg(Object msg)
msg - the ROS message that the this object has periodically publishedpublic int getTimeDelay()
publishAction(Action) methodpublishAction(Action) methodpublic void setTimeDelay(int timeDelay)
publishAction(Action) methodtimeDelay - the time delay in milliseconds returned by the publishAction(Action) methodpublic int publishAction(burlap.mdp.core.action.Action a)
ActionPublisherAction turns into a ROS message, and publishes it to ROS through this
object's ROS Bridge Publisher object. Note that when you implement this method, you must make the publish
call to ROSBridge yourself using a Publisher object.publishAction in interface ActionPublishera - The BURLAP Action to turn into a ROS message and publish.Copyright © 2016. All rights reserved.