forked from ros-industrial-attic/reuleaux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
159d5ac
commit 84d5a79
Showing
16 changed files
with
1,925 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
base_placement_plugin/include/base_placement_plugin/add_robot_base.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#ifndef ADD_ROBOT_BASE_H | ||
#define ADD_ROBOT_BASE_H | ||
#ifndef Q_MOC_RUN | ||
#include<stdio.h> | ||
#include<iostream> | ||
#include <string.h> | ||
#include <math.h> | ||
#include <algorithm> | ||
#include <vector> | ||
#include <iterator> | ||
|
||
#include <rviz/panel.h> | ||
#include <ros/ros.h> | ||
#include <interactive_markers/interactive_marker_server.h> | ||
#include <interactive_markers/menu_handler.h> | ||
#include <rviz/default_plugin/interactive_markers/interactive_marker.h> | ||
#include <tf/LinearMath/Vector3.h> | ||
#include <tf/LinearMath/Scalar.h> | ||
#include <geometry_msgs/Pose.h> | ||
#include <geometry_msgs/PointStamped.h> | ||
#include <std_msgs/ColorRGBA.h> | ||
#include <tf/tf.h> | ||
#include <tf/transform_listener.h> | ||
#include <tf/message_filter.h> | ||
#include <message_filters/subscriber.h> | ||
|
||
#include <rviz/properties/bool_property.h> | ||
#include <rviz/properties/string_property.h> | ||
#include <base_placement_plugin/widgets/base_placement_widget.h> | ||
#include <base_placement_plugin/place_base.h> | ||
|
||
#include <QWidget> | ||
#include <QCursor> | ||
#include <QObject> | ||
#include <QKeyEvent> | ||
#include <QHBoxLayout> | ||
#include <QTimer> | ||
#include <QtConcurrentRun> | ||
#include <QFuture> | ||
|
||
#endif | ||
|
||
|
||
namespace rviz | ||
{ | ||
class VectorProperty; | ||
class VisualizationManager; | ||
class ViewportMouseEvent; | ||
class StringProperty; | ||
class BoolProperty; | ||
} | ||
|
||
|
||
class AddRobotBase : public QObject | ||
{ | ||
Q_OBJECT; | ||
public: | ||
AddRobotBase(QWidget* parent = 0); | ||
virtual ~AddRobotBase(); | ||
void init(); | ||
|
||
virtual void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback); | ||
|
||
void changeMarkerControlAndPose(std::string marker_name, bool set_control); | ||
visualization_msgs::InteractiveMarkerControl& makeArrowControlDefault(visualization_msgs::InteractiveMarker& msg); | ||
visualization_msgs::InteractiveMarkerControl& makeArrowControlDetails(visualization_msgs::InteractiveMarker& msg); | ||
visualization_msgs::Marker makeWayPoint(visualization_msgs::InteractiveMarker& msg); | ||
void pointDeleted(std::string marker_name); | ||
void makeArrow(const tf::Transform& point_pos, int count_arrow); | ||
void makeInteractiveMarker(); | ||
visualization_msgs::InteractiveMarkerControl& makeInteractiveMarkerControl(visualization_msgs::InteractiveMarker& msg); | ||
visualization_msgs::Marker makeInterArrow(visualization_msgs::InteractiveMarker& msg); | ||
|
||
void pointPoseUpdated(const tf::Transform& point_pos, const char* marker_name); | ||
void getWaypoints(std::vector<geometry_msgs::Pose>& waypoints); | ||
|
||
|
||
public Q_SLOTS: | ||
void parseWayPoints(); | ||
void clearAllPointsRviz(); | ||
|
||
void getRobotModelFrame_slot(const tf::Transform end_effector); | ||
|
||
protected: | ||
QWidget* widget_; | ||
|
||
Q_SIGNALS: | ||
void baseWayPoints_signal(std::vector<geometry_msgs::Pose> base_poses); | ||
|
||
private: | ||
//! Define a server for the Interactive Markers. | ||
boost::shared_ptr< interactive_markers::InteractiveMarkerServer > server; | ||
interactive_markers::MenuHandler menu_handler; | ||
|
||
//! for arrows...........need to be modified | ||
std_msgs::ColorRGBA WAY_POINT_COLOR; | ||
std_msgs::ColorRGBA ARROW_INTER_COLOR; | ||
geometry_msgs::Vector3 WAY_POINT_SCALE_CONTROL; | ||
geometry_msgs::Vector3 ARROW_INTER_SCALE_CONTROL; | ||
float INTERACTIVE_MARKER_SCALE; | ||
float ARROW_INTERACTIVE_SCALE; | ||
|
||
//! Vector for storing all the User Entered Way-Points. | ||
std::vector< tf::Transform > waypoints_pos; | ||
//! The position of the User handlable Interactive Marker. | ||
tf::Transform box_pos; | ||
int count; | ||
std::string target_frame_; | ||
|
||
}; | ||
|
||
|
||
|
||
|
||
|
||
|
||
#endif // ADD_ROBOT_BASE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
base_placement_plugin/include/base_placement_plugin/create_marker.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef CREATE_MARKER_H | ||
#define CREATE_MARKER_H | ||
|
||
#include<ros/ros.h> | ||
#include<geometry_msgs/Pose.h> | ||
#include<visualization_msgs/InteractiveMarker.h> | ||
#include<tf2/LinearMath/Transform.h> | ||
#include<tf2/LinearMath/Quaternion.h> | ||
|
||
#include<moveit/move_group_interface/move_group.h> | ||
|
||
#include<moveit/robot_model_loader/robot_model_loader.h> | ||
#include<moveit/robot_model/robot_model.h> | ||
#include<moveit/robot_model/joint_model_group.h> | ||
|
||
#include<moveit/robot_state/robot_state.h> | ||
|
||
typedef std::multimap<std::vector<double>,geometry_msgs::Pose> BasePoseJoint; | ||
|
||
class CreateMarker{ | ||
public: | ||
CreateMarker(std::string group_name); | ||
|
||
|
||
bool makeArmMarker(BasePoseJoint baseJoints, std::vector<visualization_msgs::InteractiveMarker>& iMarkers, bool show_unreachable_models); //visualizing robot model with joint solutions | ||
bool makeRobotMarker(BasePoseJoint baseJoints, std::vector<visualization_msgs::InteractiveMarker>& iMarkers, bool show_unreachable_models); //visualizing robot model with joint solutions | ||
bool checkForEE(); | ||
|
||
|
||
|
||
private: | ||
|
||
std::string group_name_; | ||
ros::AsyncSpinner spinner; | ||
boost::scoped_ptr<moveit::planning_interface::MoveGroup> group_; | ||
//Robot model cons pointer | ||
moveit::core::RobotModelConstPtr robot_model_; | ||
}; | ||
|
||
#endif // CREATE_MARKER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.