All Classes Namespaces Files Functions Variables Typedefs
Functions | Variables
rviz_gripper.cpp File Reference
#include <ros/ros.h>
#include <string>
#include <std_msgs/Float32.h>
#include <std_msgs/Bool.h>
#include <sensor_msgs/JointState.h>
Include dependency graph for rviz_gripper.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 Main method reads if the state of the gripper is changing and simulates this in RVIZ. More...
 
void rvizUpdater (const std_msgs::Float32::ConstPtr &msg)
 update method the opens variable will be updated More...
 
void shutdown (const std_msgs::Bool::ConstPtr &b)
 Controll method to shutdown this ROS node when the command is given. More...
 

Variables

const int freq = 250
 
float opens
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Main method reads if the state of the gripper is changing and simulates this in RVIZ.

This node listens to the gripper_state published by gripper_actuator. motor_state variable has a value between 1 and 0. 1 means completly open 0 means completly closed. bmdll_max angle that the joint between middle and base can make. mlltp_max angle that the joint between middle and finger tip can make. bmdll_start start angle of the joint between middle and base mdlltp_start start angle of the joint between middle and tip bm_angle current angle between base and middle mt_angle current angle between middle and tip step_size the change of motor_state per loop cf corection facter the factor the raid at which the tip moves faster then the middle part angle_step the inverse of the total angle that can be made by the two joints

The motor_state is only changed if the gripper opens or closes and the motor state is between 1 and 0 The new motor_state is converted to angles for the both joints. The new angles will be published in the jstates topic

See Also
shiftBuffer(int), mean()

Definition at line 36 of file rviz_gripper.cpp.

void rvizUpdater ( const std_msgs::Float32::ConstPtr &  msg)

update method the opens variable will be updated

Method for publishing a cylinder in rviz.

Parameters
msgcontains the value 0,1,0.5 depending if the gripper is openening, closing or relaxing.

This Method creates a marker message to create a cylinder in rviz. The frame where the marker in will be plotted in rviz is the base frame of the gripper. The marker will be deleted if there is no object in the range of the sensor. The type of the marker is a cylinder. Marker will be placed on the y-axis on the measured distance from the origin The size of the marker is determined with the diameter and height variable. The color of the marker is green.

Definition at line 97 of file rviz_gripper.cpp.

void shutdown ( const std_msgs::Bool::ConstPtr &  b)

Controll method to shutdown this ROS node when the command is given.

This method will shutdown this node when the command is given by the console.

Parameters
bThe message containing the command. Nothing is done with the command since we know what it will be when this message is received.

Variable Documentation

const int freq = 250

The frequency at which gripper in rviz is updated.

Definition at line 13 of file rviz_gripper.cpp.

float opens

The state of the gripper 0 when gripper closes, 1 when gripper opens, 0.5 in relax mode.

Definition at line 12 of file rviz_gripper.cpp.



Grijper
Author(s): Stijn van Schooten, Wybren ten Cate, Florens Kreuk, Jan Wymenga,Joris Coenen, Roy Groot
autogenerated on Thu Oct 3 2013 22:59:42