10 #include <jsk_interactive_marker/SetPose.h> 11 #include <jsk_interactive_marker/MarkerSetPose.h> 14 #include <jsk_interactive_marker/MarkerMenu.h> 15 #include <jsk_interactive_marker/MarkerPose.h> 17 #include <std_msgs/Int8.h> 18 #include "urdf_parser/urdf_parser.h" 19 #if ROS_VERSION_MINIMUM(1,12,0) // kinetic 20 #include <urdf_world/types.h> 47 visualization_msgs::InteractiveMarker make6DofControlMarker( std::string name, geometry_msgs::PoseStamped &stamped,
float scale,
bool fixed_position,
bool fixed_rotation);
49 void proc_feedback(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
50 void proc_feedback(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback,
int type );
51 void pub_marker_tf ( std_msgs::Header header, geometry_msgs::Pose pose);
52 void pub_marker_pose ( std_msgs::Header header, geometry_msgs::Pose pose, std::string name,
int type );
54 void pub_marker_menu(std::string marker,
int menu,
int type);
55 void pub_marker_menu(std::string marker,
int menu);
57 void pub_marker_menuCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback,
int menu );
59 void pub_marker_menuCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback,
int menu,
int type);
61 void IMSizeLargeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
63 void IMSizeMiddleCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
65 void IMSizeSmallCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
67 void changeMoveModeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
69 void changeMoveModeCb1(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
71 void changeMoveModeCb2(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
73 void changeForceModeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
75 void changeForceModeCb1(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
77 void changeForceModeCb2(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
80 void targetPointMenuCB(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
82 void lookAutomaticallyMenuCB(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
84 void ConstraintCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
86 void modeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
88 void changeMoveArm( std::string m_name,
int menu );
90 void setOriginCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback,
bool origin_hand);
92 void ikmodeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
93 void toggleIKModeCb(
const std_msgs::EmptyConstPtr &msg);
94 void useTorsoCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
96 void usingIKCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback );
98 void marker_menu_cb(
const jsk_interactive_marker::MarkerMenuConstPtr &msg);
100 void updateHeadGoal(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback);
101 void updateBase(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback);
102 void updateFinger(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback, std::string hand);
104 visualization_msgs::InteractiveMarker
makeBaseMarker(
const char *name,
const geometry_msgs::PoseStamped &stamped,
float scale,
bool fixed);
108 void changeMarkerForceMode( std::string mk_name ,
int im_mode);
110 void toggleStartIKCb(
const std_msgs::EmptyConstPtr &msg);
112 void initControlMarkers(
void);
114 void initBodyMarkers(
void);
116 void initHandler(
void);
118 void changeMarkerMoveMode( std::string mk_name ,
int im_mode);
120 void changeMarkerMoveMode( std::string mk_name ,
int im_mode,
float mk_size);
122 void changeMarkerMoveMode( std::string mk_name ,
int im_mode,
float mk_size, geometry_msgs::PoseStamped dist_pose);
124 void changeMarkerOperationModelMode( std::string mk_name );
127 void addHandMarker(visualization_msgs::InteractiveMarker &im,std::vector < UrdfProperty > urdf_vec);
128 void addSphereMarker(visualization_msgs::InteractiveMarker &im,
double scale, std_msgs::ColorRGBA color);
129 void makeCenterSphere(visualization_msgs::InteractiveMarker &mk,
double mk_size);
133 bool markers_set_cb ( jsk_interactive_marker::MarkerSetPose::Request &req,
134 jsk_interactive_marker::MarkerSetPose::Response &res );
136 bool markers_del_cb ( jsk_interactive_marker::MarkerSetPose::Request &req,
137 jsk_interactive_marker::MarkerSetPose::Response &res );
139 void move_marker_cb (
const geometry_msgs::PoseStampedConstPtr &msg);
141 bool set_cb ( jsk_interactive_marker::MarkerSetPose::Request &req,
142 jsk_interactive_marker::MarkerSetPose::Response &res );
144 bool reset_cb ( jsk_interactive_marker::SetPose::Request &req,
145 jsk_interactive_marker::SetPose::Response &res );
147 void loadMeshFromYaml(
XmlRpc::XmlRpcValue val, std::string name, std::vector<MeshProperty>& mesh);
148 void loadUrdfFromYaml(
XmlRpc::XmlRpcValue val, std::string name, std::vector<UrdfProperty>& mesh);
151 void makeIMVisible(visualization_msgs::InteractiveMarker &im);
157 std::shared_ptr<interactive_markers::InteractiveMarkerServer>
server_;
223 std::list<visualization_msgs::InteractiveMarker>
imlist;
227 GripperState() : on_(false), view_facing_(false), edit_control_(false), torso_frame_(false) {}
236 ControlState() : posture_r_(false), posture_l_(false), torso_on_(false), head_on_(false),
237 projector_on_(false), init_head_goal_(false), base_on_(true), r_finger_on_(false), l_finger_on_(false), move_arm_(RARM), move_origin_state_(HAND_ORIGIN) {}
241 ROS_DEBUG_NAMED(
"control_state",
"gripper: on[%d|%d][%d], edit[%d|%d][%d], torso[%d|%d]",
242 l_gripper_.on_, r_gripper_.on_, dual_grippers_.on_, l_gripper_.edit_control_, r_gripper_.edit_control_, dual_grippers_.edit_control_, l_gripper_.torso_frame_, r_gripper_.torso_frame_);
243 ROS_DEBUG_NAMED(
"control_state",
"posture[%d|%d] torso[%d] base[%d] head[%d] projector[%d]",
244 posture_l_, posture_r_, torso_on_, base_on_, head_on_, projector_on_ );
interactive_markers::MenuHandler menu_handler
interactive_markers::MenuHandler menu_head_
std_msgs::ColorRGBA color
interactive_markers::MenuHandler::EntryHandle start_ik_menu_
geometry_msgs::Quaternion orientation
interactive_markers::MenuHandler menu_handler_force
std::string move_base_frame
interactive_markers::MenuHandler menu_handler1
interactive_markers::MenuHandler::EntryHandle stop_ik_menu_
geometry_msgs::PoseStamped head_goal_pose_
std::vector< UrdfProperty > rhand_urdf_
interactive_markers::MenuHandler::EntryHandle use_torso_t_menu_
tf::TransformBroadcaster tfb_
ros::ServiceServer serv_markers_del_
ControlState control_state_
ros::ServiceServer serv_markers_set_
interactive_markers::MenuHandler::EntryHandle h_mode_last3
interactive_markers::MenuHandler::EntryHandle sub_menu_handle2
interactive_markers::MenuHandler::EntryHandle head_auto_look_handle_
interactive_markers::MenuHandler menu_base_
visualization_msgs::InteractiveMarker makeBaseMarker(const char *name, const geometry_msgs::PoseStamped &stamped, float scale, bool fixed)
interactive_markers::MenuHandler::EntryHandle h_mode_last
interactive_markers::MenuHandler menu_handler_force2
std::string head_link_frame_
#define ROS_DEBUG_NAMED(name,...)
ros::Subscriber sub_toggle_start_ik_
geometry_msgs::Point position
MoveOriginState move_origin_state_
interactive_markers::MenuHandler menu_finger_r_
interactive_markers::MenuHandler menu_head_target_
interactive_markers::MenuHandler::EntryHandle sub_menu_handle
boost::shared_ptr< ModelInterface > ModelInterfaceSharedPtr
ros::ServiceClient dynamic_tf_publisher_client_
interactive_markers::MenuHandler::EntryHandle use_fullbody_menu_
ros::ServiceServer serv_set_
std::list< visualization_msgs::InteractiveMarker > imlist
ros::Subscriber sub_marker_pose_
ros::Subscriber sub_toggle_ik_mode_
ros::Subscriber sub_marker_menu_
std::vector< MeshProperty > rhand_mesh_
std::string root_link_name
urdf::ModelInterfaceSharedPtr model
interactive_markers::MenuHandler::EntryHandle rotation_nil_menu_
interactive_markers::MenuHandler::EntryHandle sub_menu_handle_ik
interactive_markers::MenuHandler menu_handler2
GripperState dual_grippers_
std::shared_ptr< interactive_markers::InteractiveMarkerServer > server_
interactive_markers::MenuHandler::EntryHandle use_torso_menu_
interactive_markers::MenuHandler::EntryHandle head_target_handle_
ros::ServiceServer serv_reset_
geometry_msgs::PoseStamped marker_pose_
ros::Publisher pub_update_
interactive_markers::MenuHandler menu_handler_force1
interactive_markers::MenuHandler menu_finger_l_
interactive_markers::MenuHandler::EntryHandle rotation_t_menu_
interactive_markers::MenuHandler::EntryHandle h_mode_last2
interactive_markers::MenuHandler::EntryHandle use_torso_nil_menu_