ROS Serial C client library
|
ROS Serial C client library header. More...
#include "ros_std.h"
#include "ros_config.h"
#include "ros_types.h"
#include "ros_time.h"
#include "ros_packet.h"
#include "ros_spinner.h"
#include "ros_hardware.h"
#include "ros_os.h"
#include "TopicInfoC.h"
#include "TimeC.h"
Go to the source code of this file.
Functions | |
void | rosInit (char *private_namespace) |
Initializes ROS. | |
rosNodeHandle_t * | rosNodeHandle (char *device_id) |
Get pointer to global nodehandle. | |
rosReturnCode_t | rosOk (rosNodeHandle_t *nodehandle) |
Checks if nodehandle is still alive. | |
void | rosSpin (rosNodeHandle_t *nodehandle) |
Spins global nodehandle continously. | |
void | rosSpinOnce (rosNodeHandle_t *nodehandle) |
Spins global nodehandle once. | |
void | rosShutdown () |
Shutdown ROS. | |
rosReturnCode_t | rosPublish (void *message) |
Nodehandle publish implementation. | |
rosPublisher_t * | rosAdvertise (rosMessageHandle_t *messagehandle, char *topic, uint16_t buffer_size) |
Nodehandle advertise implementation. | |
rosSubscriber_t * | rosSubscribe (rosMessageHandle_t *messagehandle, char *topic, uint16_t buffer_size, void(*callback)(void *message)) |
Nodehandle subscribe implementation. |
ROS Serial C client library header.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
void rosInit | ( | char * | private_namespace | ) |
Initializes ROS.
private_namespace | the namespace all topics are published or subscribed in |
Example Usage:
// init ROS rosInit(NULL); // Nothing is prepended befor topic name
or
// init ROS rosInit("my_namespace"); // topics are published as "/my_namespace/topic_name"
rosNodeHandle_t* rosNodeHandle | ( | char * | device_id | ) |
Get pointer to global nodehandle.
rosReturnCode_t rosOk | ( | rosNodeHandle_t * | nodehandle | ) |
Checks if nodehandle is still alive.
ROS_NOT_OK | comparable with false |
ROS_OK | comparable with true |
Example Usage:
while(rosOk()) { // Do something here. }
void rosShutdown | ( | ) |
Shutdown ROS.
Kills global nodehandle and powers down the board if desired.
void rosSpin | ( | rosNodeHandle_t * | nodehandle | ) |
Spins global nodehandle continously.
Read continously bytes input buffer and process subscribed callbacks.
Example Usage:
// init ROS rosInit(NULL); // get pointer to global nodehandle rosNodeHandle_t* nh = rosNodeHandle(); // create message MyMessage_t my_message = rosCreateMyMessage_t(); // advertise message rosSubscriber_t* my_message_sub = nh->subscribe(&my_message.messagehandle, "MyMessage", 512, myMessageCallback); // spin ROS continously to process callbacks rosSpin();
void rosSpinOnce | ( | rosNodeHandle_t * | nodehandle | ) |
Spins global nodehandle once.
Reads all current available bytes from input buffer and process subscribed callbacks.
Example Usage:
// init ROS rosInit(NULL); // get pointer to global nodehandle rosNodeHandle_t* nh = rosNodeHandle(); // create message MyMessage_t my_message = rosCreateMyMessage_t(); // advertise message rosSubscriber_t* my_message_sub = nh->subscribe(&my_message.messagehandle, "MyMessage", 512, myMessageCallback); // enter loop while(rosOk()) { // Do something here. // spin nodehandle once to process callbacks rosSpinOnce(); }