Skip to content

Commit

Permalink
Merge pull request #32 from geoffreychiou/indigo-devel
Browse files Browse the repository at this point in the history
PCA, build and namespace Fixes
  • Loading branch information
akgoins authored Dec 9, 2016
2 parents 09959b8 + 8ae2954 commit 140a3e5
Show file tree
Hide file tree
Showing 22 changed files with 491 additions and 441 deletions.
2 changes: 1 addition & 1 deletion base_placement_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ qt4_wrap_ui(base_placement_plugin_UIS_H ${base_placement_plugin_UIS})

include_directories(${base_placement_plugin_INCLUDE_DIRECTORIES} ${catkin_INCLUDE_DIRS})
add_library(${PROJECT_NAME} ${base_placement_plugin_SRCS} ${base_placement_plugin_MOCS} ${base_placement_plugin_UIS_H}) # ${base_placement_plugin_UIS_H}
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} yaml-cpp -lhdf5 -lhdf5_cpp hdf5_dataset sphere_discretization kinematics )
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} yaml-cpp -lhdf5 -lhdf5_cpp)
## target_link_libraries(${PROJECT_NAME} yaml-cpp)

find_package(class_loader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class StringProperty;
class BoolProperty;
}

using namespace visualization_msgs;
namespace base_placement_plugin
{
/*!
Expand Down Expand Up @@ -81,17 +80,17 @@ class AddWayPoint : public rviz::Panel

private:
//! Function for creating a way-point marker
Marker makeWayPoint(InteractiveMarker& msg);
visualization_msgs::Marker makeWayPoint(visualization_msgs::InteractiveMarker& msg);
//! Function to create the InteractionArrow Marker
Marker makeInterArrow(InteractiveMarker& msg);
visualization_msgs::Marker makeInterArrow(visualization_msgs::InteractiveMarker& msg);
//! Create controls for each different marker. Here we have control for the defaulot starting control ArrowMarkers
InteractiveMarkerControl& makeArrowControlDefault(InteractiveMarker& msg);
visualization_msgs::InteractiveMarkerControl& makeArrowControlDefault(visualization_msgs::InteractiveMarker& msg);
//! 6DOF control for the Ingteractive Markers
InteractiveMarkerControl& makeArrowControlDetails(InteractiveMarker& msg);
visualization_msgs::InteractiveMarkerControl& makeArrowControlDetails(visualization_msgs::InteractiveMarker& msg);

//! The box control can be used as a pointer to a certain 3D location and when clicked it will add a arrow to that
// location.
InteractiveMarkerControl& makeInteractiveMarkerControl(InteractiveMarker& msg_box);
visualization_msgs::InteractiveMarkerControl& makeInteractiveMarkerControl(visualization_msgs::InteractiveMarker& msg_box);
//! Function to handle the entries made from the Way-Points interactive markers Menu.
virtual void changeMarkerControlAndPose(std::string marker_name, bool set_control);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


#include <tf/tf.h>
#include <tf_conversions/tf_eigen.h>

Expand Down
69 changes: 34 additions & 35 deletions base_placement_plugin/src/add_way_point.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include <base_placement_plugin/add_way_point.h>

namespace base_placement_plugin
Expand Down Expand Up @@ -278,54 +277,54 @@ void AddWayPoint::pointPoseUpdated(const tf::Transform& point_pos, const char* m
server->applyChanges();
}

Marker AddWayPoint::makeWayPoint(InteractiveMarker& msg)
visualization_msgs::Marker AddWayPoint::makeWayPoint(visualization_msgs::InteractiveMarker& msg)
{
/*! Define a type and properties of a Marker for the Way-Point.
This will be use as a base to define the shape, color and scale of the InteractiveMarker for the Way-Points.
*/
Marker marker;
visualization_msgs::Marker marker;

marker.type = Marker::ARROW;
marker.type = visualization_msgs::Marker::ARROW;
marker.scale = WAY_POINT_SCALE_CONTROL;

marker.color = WAY_POINT_COLOR;
marker.action = visualization_msgs::Marker::ADD;
return marker;
}

InteractiveMarkerControl& AddWayPoint::makeArrowControlDefault(InteractiveMarker& msg)
visualization_msgs::InteractiveMarkerControl& AddWayPoint::makeArrowControlDefault(visualization_msgs::InteractiveMarker& msg)
{
InteractiveMarkerControl control_menu;
visualization_msgs::InteractiveMarkerControl control_menu;
control_menu.always_visible = true;

control_menu.interaction_mode = InteractiveMarkerControl::MENU;
control_menu.interaction_mode = visualization_msgs::InteractiveMarkerControl::MENU;

control_menu.name = "menu_select";
msg.controls.push_back(control_menu);
control_menu.markers.push_back(makeWayPoint(msg));

InteractiveMarkerControl control_move3d;
visualization_msgs::InteractiveMarkerControl control_move3d;
control_move3d.always_visible = true;

control_move3d.interaction_mode = InteractiveMarkerControl::MOVE_ROTATE_3D;
control_move3d.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_ROTATE_3D;
control_move3d.name = "move";
control_move3d.markers.push_back(makeWayPoint(msg));
msg.controls.push_back(control_move3d);

return msg.controls.back();
}

InteractiveMarkerControl& AddWayPoint::makeArrowControlDetails(InteractiveMarker& msg)
visualization_msgs::InteractiveMarkerControl& AddWayPoint::makeArrowControlDetails(visualization_msgs::InteractiveMarker& msg)
{
InteractiveMarkerControl control_menu;
visualization_msgs::InteractiveMarkerControl control_menu;
control_menu.always_visible = true;

control_menu.interaction_mode = InteractiveMarkerControl::MENU;
control_menu.interaction_mode = visualization_msgs::InteractiveMarkerControl::MENU;
control_menu.name = "menu_select";
msg.controls.push_back(control_menu);
control_menu.markers.push_back(makeWayPoint(msg));

InteractiveMarkerControl control_view_details;
visualization_msgs::InteractiveMarkerControl control_view_details;
control_view_details.always_visible = true;
//*************rotate and move around the x-axis********************
control_view_details.orientation.w = 1;
Expand All @@ -334,11 +333,11 @@ InteractiveMarkerControl& AddWayPoint::makeArrowControlDetails(InteractiveMarker
control_view_details.orientation.z = 0;

control_view_details.name = "rotate_x";
control_view_details.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;
msg.controls.push_back(control_view_details);

control_view_details.name = "move_x";
control_view_details.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_view_details);
//*****************************************************************

Expand All @@ -349,11 +348,11 @@ InteractiveMarkerControl& AddWayPoint::makeArrowControlDetails(InteractiveMarker
control_view_details.orientation.z = 0;

control_view_details.name = "rotate_z";
control_view_details.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;
msg.controls.push_back(control_view_details);

control_view_details.name = "move_z";
control_view_details.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_view_details);
//*****************************************************************

Expand All @@ -364,12 +363,12 @@ InteractiveMarkerControl& AddWayPoint::makeArrowControlDetails(InteractiveMarker
control_view_details.orientation.z = 1;

control_view_details.name = "rotate_y";
control_view_details.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;

msg.controls.push_back(control_view_details);

control_view_details.name = "move_y";
control_view_details.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_view_details.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_view_details);
control_view_details.markers.push_back(makeWayPoint(msg));

Expand All @@ -384,7 +383,7 @@ void AddWayPoint::makeArrow(const tf::Transform& point_pos, int count_arrow) //
/*! Function for adding a new Way-Point in the RViz scene and here we send the signal to notify the RQT Widget that a
* new Way-Point has been added.
*/
InteractiveMarker int_marker;
visualization_msgs::InteractiveMarker int_marker;

ROS_INFO_STREAM("Markers frame is: " << target_frame_);

Expand Down Expand Up @@ -452,7 +451,7 @@ void AddWayPoint::changeMarkerControlAndPose(std::string marker_name, bool set_c
/*! Handling the events from the clicked Menu Items for the Control of the Way-Point.
Here the user can change the control either to freely move the Way-Point or get the 6DOF pose control option.
*/
InteractiveMarker int_marker;
visualization_msgs::InteractiveMarker int_marker;
server->get(marker_name, int_marker);

if (set_control)
Expand Down Expand Up @@ -505,15 +504,15 @@ void AddWayPoint::pointDeleted(std::string marker_name)
server->applyChanges();
}

Marker AddWayPoint::makeInterArrow(InteractiveMarker& msg)
visualization_msgs::Marker AddWayPoint::makeInterArrow(visualization_msgs::InteractiveMarker& msg)
{
/*! Define the Marker Arrow which the user can add new Way-Points with.
*/
// define a marker
Marker marker;
visualization_msgs::Marker marker;

marker.type = Marker::ARROW;
marker.type = visualization_msgs::Marker::ARROW;
marker.scale = ARROW_INTER_SCALE_CONTROL;

// make the markers with interesting color
Expand All @@ -522,20 +521,20 @@ Marker AddWayPoint::makeInterArrow(InteractiveMarker& msg)
return marker;
}

InteractiveMarkerControl& AddWayPoint::makeInteractiveMarkerControl(InteractiveMarker& msg)
visualization_msgs::InteractiveMarkerControl& AddWayPoint::makeInteractiveMarkerControl(visualization_msgs::InteractiveMarker& msg)
{
/*! Set the User Interactive Marker with 6DOF control.
*/
// //control for button interaction
InteractiveMarkerControl control_button;
visualization_msgs::InteractiveMarkerControl control_button;
control_button.always_visible = true;
control_button.interaction_mode = InteractiveMarkerControl::BUTTON;
control_button.interaction_mode = visualization_msgs::InteractiveMarkerControl::BUTTON;
control_button.name = "button_interaction";
control_button.markers.push_back(makeInterArrow(msg));

msg.controls.push_back(control_button);
// server.reset( new interactive_markers::InteractiveMarkerServer("base_placement_plugin","",false));
InteractiveMarkerControl control_inter_arrow;
visualization_msgs::InteractiveMarkerControl control_inter_arrow;
control_inter_arrow.always_visible = true;
//*************rotate and move around the x-axis********************
control_inter_arrow.orientation.w = 1;
Expand All @@ -544,11 +543,11 @@ InteractiveMarkerControl& AddWayPoint::makeInteractiveMarkerControl(InteractiveM
control_inter_arrow.orientation.z = 0;

control_inter_arrow.name = "rotate_x";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;
msg.controls.push_back(control_inter_arrow);

control_inter_arrow.name = "move_x";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_inter_arrow);
//*****************************************************************

Expand All @@ -559,11 +558,11 @@ InteractiveMarkerControl& AddWayPoint::makeInteractiveMarkerControl(InteractiveM
control_inter_arrow.orientation.z = 0;

control_inter_arrow.name = "rotate_z";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;
msg.controls.push_back(control_inter_arrow);

control_inter_arrow.name = "move_z";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_inter_arrow);
//*****************************************************************

Expand All @@ -574,11 +573,11 @@ InteractiveMarkerControl& AddWayPoint::makeInteractiveMarkerControl(InteractiveM
control_inter_arrow.orientation.z = 1;

control_inter_arrow.name = "rotate_y";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS;
msg.controls.push_back(control_inter_arrow);

control_inter_arrow.name = "move_y";
control_inter_arrow.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
control_inter_arrow.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
msg.controls.push_back(control_inter_arrow);
//*****************************************************************
control_inter_arrow.markers.push_back(makeInterArrow(msg));
Expand All @@ -591,7 +590,7 @@ void AddWayPoint::makeInteractiveMarker()
/*! Create the User Interactive Marker and update the RViz enviroment.
*/
InteractiveMarker inter_arrow_marker_;
visualization_msgs::InteractiveMarker inter_arrow_marker_;
inter_arrow_marker_.header.frame_id = target_frame_;
inter_arrow_marker_.scale = ARROW_INTERACTIVE_SCALE;

Expand Down
Loading

0 comments on commit 140a3e5

Please sign in to comment.