Skip to content

Instantly share code, notes, and snippets.

@prrraveen
Created July 19, 2015 08:45
Show Gist options
  • Save prrraveen/feeda8d47fa1c38c084f to your computer and use it in GitHub Desktop.
Save prrraveen/feeda8d47fa1c38c084f to your computer and use it in GitHub Desktop.
namespace ros_control_boilerplate
{
class JoystickManualControl
{
public:
/**
* \brief Constructor
* \param parent_name - name of parent class, only used for namespacing logging debug output
* \param service_namespace - prefix to controller manager service, or blank. do not add trailing "/"
*/
JoystickManualControl(const std::string& parent_name, const std::string& service_namespace)
: parent_name_(parent_name)
, using_trajectory_controller_(true)
{
switch_service_ = service_namespace + "/controller_manager/switch_controller";
load_service_ = service_namespace + "/controller_manager/load_controller";
// Switch modes of controllers
switch_controlers_client_ = nh_.serviceClient<controller_manager_msgs::SwitchController>(switch_service_);
load_controlers_client_ = nh_.serviceClient<controller_manager_msgs::LoadController>(load_service_);
// Subscribe to joystick control
std::size_t queue_size = 1;
remote_joy_ = nh_.subscribe("/joy", queue_size, &JoystickManualControl::joyCallback, this);
ROS_INFO_STREAM_NAMED(parent_name_,"JoystickManualControl Ready.");
}
@prrraveen
Copy link
Author

they have called to functions in line 14 , 15 after JoystickManualControl() :foo bar {}.

Is it correct syntex?
What is does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment