/get_user_input#
Caution
This documentation page has been auto-generated.
It may be missing some details.
/get_user_input Quick Facts
- Category
- Message type
Quick snippets#
Send a goal from the command-line#
$ rostopic pub /get_user_input/goal pal_web_msgs/GetUserInputActionGoal # press Tab to complete the message prototype
How to use in your code#
Call the action from a Python script#
#!/usr/bin/env python
import rospy
import actionlib
from pal_web_msgs.msg import *
if __name__ == "__main__":
    client = actionlib.SimpleActionClient("/get_user_input", pal_web_msgs.msg.GetUserInputAction)
    client.wait_for_server()
    # check https://github.com/pal-robotics/pal_msgs/tree/indigo-devel/pal_web_msgs/action/GetUserInput.action
    # for the possible goal parameters
    goal = pal_web_msgs.msg.GetUserInputGoal(param1=..., param2=...)
    client.send_goal(goal)
    client.wait_for_result()
    rospy.loginfo("Action returned: %s" % client.get_result())
Call the action using 
SimpleActionClient##include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>
#include <pal_web_msgs/GetUserInputAction.h>
int main (int argc, char **argv)
{
  ros::init(argc, argv, "get_user_input_action_client");
  // create the action client
  // true causes the client to spin its own thread
  actionlib::SimpleActionClient<:pal_web_msgs::GetUserInputAction> ac("/get_user_input", true);
  ROS_INFO("Waiting for action server to start.");
  // wait for the action server to start
  ac.waitForServer(); //will wait for infinite time
  ROS_INFO("Action server started, sending goal.");
  // send a goal to the action
  pal_web_msgs::GetUserInputGoal goal;
  // check https://github.com/pal-robotics/pal_msgs/tree/indigo-devel/pal_web_msgs/action/GetUserInput.action
  // for the possible goal parameters
  // goal.... = ...;
  ac.sendGoal(goal);
  //wait for the action to return
  bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0));
  if (finished_before_timeout)
  {
    actionlib::SimpleClientGoalState state = ac.getState();
    ROS_INFO("Action finished: %s",state.toString().c_str());
  }
  else
  {
    ROS_INFO("Action did not finish before the time out.");
    ac.cancelGoal();
  }
  return 0;
}
You can also access this action from a webpage displayed on the robot’s touchscreen via this endpoint:
http://<robot>-0c/action/get_user_input
(replace <robot>-0c by the serial number of your own robot).
See REST interface for the general documentation of the REST endpoints and code samples.