Klamp't  0.9.0
ROS.h
1 #ifndef IO_ROS_H
2 #define IO_ROS_H
3 
4 #include <vector>
5 #include <KrisLibrary/math3d/primitives.h>
6 //forward declarations
7 namespace Meshing { class PointCloud3D; }
8 
9 namespace Klampt {
10 class WorldModel;
11 class RobotModel;
12 class SimRobotController;
13 class Simulator;
14 class LinearPath;
15 class SensorBase;
16 
19 
23 bool ROSInit(const char* nodename="klampt");
25 bool ROSShutdown();
27 bool ROSInitialized();
30 bool ROSSubscribeUpdate();
32 bool ROSDetach(const char* topic);
39 bool ROSIsConnected(const char* topic);
41 std::string ROSFrame(const char* topic);
46 bool ROSWaitForUpdate(const char* topic,double timeout=0);
48 bool ROSHadUpdate(const char* topic);
50 bool ROSSetQueueSize(int size);
51 
52 bool ROSPublishPose(const Math3D::RigidTransform& T,const char* topic="klampt/transform");
53 bool ROSPublishJointState(const RobotModel& robot,const char* topic="klampt/joint_state");
54 bool ROSPublishPointCloud(const Meshing::PointCloud3D& pc,const char* topic="klampt/point_cloud");
56 bool ROSPublishTrajectory(const LinearPath& path,const char* topic="klampt/trajectory");
58 bool ROSPublishTrajectory(const RobotModel& robot,const LinearPath& path,const char* topic="klampt/trajectory");
60 bool ROSPublishTrajectory(const RobotModel& robot,const std::vector<int>& indices,const LinearPath& path,const char* topic="klampt/trajectory");
62 bool ROSPublishCommandedJointState(SimRobotController& robot,const char* topic="klampt/joint_state_commanded");
64 bool ROSPublishSensedJointState(SimRobotController& robot,const char* topic="klampt/joint_state_sensed");
69 bool ROSPublishSensorMeasurement(const SensorBase* sensor,const char* topic="klampt/sensor");
72 bool ROSPublishSensorMeasurement(const SensorBase* sensor,const RobotModel& robot,const char* topic="klampt/sensor",const char* frameprefix="klampt");
73 
77 bool ROSSubscribePose(Math3D::RigidTransform& T,const char* topic="klampt/joint_state");
81 bool ROSSubscribeJointState(RobotModel& robot,const char* topic="klampt/joint_state");
85 bool ROSSubscribePointCloud(Meshing::PointCloud3D& pc,const char* topic="klampt/point_cloud");
89 bool ROSSubscribeTrajectory(LinearPath& path,const char* topic="klampt/trajectory");
94 bool ROSSubscribeTrajectory(RobotModel& robot,LinearPath& path,const char* topic="klampt/trajectory");
95 
99 bool ROSPublishTransforms(const WorldModel& world,const char* frameprefix="klampt");
103 bool ROSPublishTransforms(const Simulator& sim,const char* frameprefix="klampt");
106 bool ROSPublishTransforms(const RobotModel& robot,const char* frameprefix="klampt");
108 bool ROSPublishTransform(const Math3D::RigidTransform& T,const char* frame="klampt_transform");
109 
114 bool ROSSubscribeTransforms(WorldModel& world,const char* frameprefix="klampt");
119 bool ROSSubscribeTransforms(RobotModel& robot,const char* frameprefix="klampt");
123 bool ROSSubscribeTransform(Math3D::RigidTransform& T,const char* frameprefix="klampt_transform");
124 
127 } //namespace Klampt
128 
129 #endif
Definition: ROS.h:7
bool ROSSubscribePointCloud(Meshing::PointCloud3D &pc, const char *topic="klampt/point_cloud")
bool ROSSetQueueSize(int size)
Sets the global queue size.
bool ROSSubscribeJointState(RobotModel &robot, const char *topic="klampt/joint_state")
bool ROSPublishTrajectory(const RobotModel &robot, const std::vector< int > &indices, const LinearPath &path, const char *topic="klampt/trajectory")
publishes a Trajectory along the specified robot indices
bool ROSShutdown()
Must call this after all other ROS[X] calls to cleanly shut down ROS.
bool ROSPublishCommandedJointState(SimRobotController &robot, const char *topic="klampt/joint_state_commanded")
publishes a JointState about the robot&#39;s current commanded joint state
int ROSNumSubscribedTopics()
Returns the number of subscribed topics.
bool ROSWaitForUpdate(const char *topic, double timeout=0)
bool ROSSubscribeTransform(Math3D::RigidTransform &T, const char *frameprefix="klampt_transform")
bool ROSPublishTransforms(const RobotModel &robot, const char *frameprefix="klampt")
bool ROSDetach(const char *topic)
Deletes a topics. [TODO] To remove the subscribed TF topics, call ...
bool ROSInit(const char *nodename="klampt")
std::string ROSFrame(const char *topic)
Returns the ROS frame ID that the data is attached to, if any.
bool ROSInitialized()
Returns true if ROS is initialized.
bool ROSHadUpdate(const char *topic)
Returns true if the ROS topic had an update on the past ROSSubscribeUpdate step.
bool ROSSubscribeTrajectory(RobotModel &robot, LinearPath &path, const char *topic="klampt/trajectory")
bool ROSSubscribeTransforms(RobotModel &robot, const char *frameprefix="klampt")
int ROSNumPublishedTopics()
Returns the number of advertised topics.
bool ROSPublishSensorMeasurement(const SensorBase *sensor, const RobotModel &robot, const char *topic="klampt/sensor", const char *frameprefix="klampt")
bool ROSIsConnected(const char *topic)
bool ROSSubscribePose(Math3D::RigidTransform &T, const char *topic="klampt/joint_state")
bool ROSPublishTransform(const Math3D::RigidTransform &T, const char *frame="klampt_transform")
Publishes the transform to the transform server under the given name.
bool ROSSubscribeUpdate()
bool ROSPublishSensedJointState(SimRobotController &robot, const char *topic="klampt/joint_state_sensed")
publishes a JointState about the robot&#39;s current sensed joint state
Definition: ContactDistance.h:6