Go to the documentation of this file. 1 #ifndef AIKIDO_RVIZ_TRAJECTORYMARKER_HPP_
2 #define AIKIDO_RVIZ_TRAJECTORYMARKER_HPP_
4 #include <dart/dynamics/Frame.hpp>
5 #include <interactive_markers/interactive_marker_server.h>
6 #include <visualization_msgs/InteractiveMarker.h>
16 class TrajectoryMarker final
40 interactive_markers::InteractiveMarkerServer* markerServer,
41 const std::string& frameId,
42 const std::string& markerName,
44 dart::dynamics::MetaSkeletonPtr skeleton,
45 const dart::dynamics::Frame& frame,
46 const Eigen::Vector4d& rgba = Eigen::Vector4d::Constant(0.75),
47 double thickness = 0.01,
48 std::size_t numLineSegments = 16u);
65 void setColor(
const Eigen::Vector3d& rgb);
77 void setRGBA(
const Eigen::Vector4d& rgb);
80 Eigen::Vector4d
getRBGA()
const;
111 const visualization_msgs::Marker&
getMarker()
const;
147 #endif // AIKIDO_RVIZ_TRAJECTORYMARKER_HPP_
void setAlpha(double alpha)
Sets or updates alpha of visualized trajectory.
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
interactive_markers::InteractiveMarkerServer * mMarkerServer
RViz marker server.
Definition: TrajectoryMarker.hpp:114
void setNumLineSegments(std::size_t numLineSegments)
Sets or updates number of line segments of the visualizing trajectory.
bool mNeedPointsUpdate
Whether the trajectory points need to be updated.
Definition: TrajectoryMarker.hpp:141
Eigen::Vector3d getColor() const
Returns color (RGB) of visualized trajectory.
std::shared_ptr< const Trajectory > ConstTrajectoryPtr
Definition: Trajectory.hpp:13
visualization_msgs::Marker & getMarker()
Returns marker.
Eigen::Vector4d getRBGA() const
Returns RGBA of visualized trajectory.
visualization_msgs::InteractiveMarker mInteractiveMarker
RViz interactive marker.
Definition: TrajectoryMarker.hpp:117
trajectory::ConstTrajectoryPtr mTrajectory
C-space (or joint-space) trajectory.
Definition: TrajectoryMarker.hpp:123
void setTrajectory(trajectory::ConstTrajectoryPtr trajectory)
Sets or updates trajectory to visualize.
std::size_t getNumLineSegments() const
Returns number of line segments of the visualizing trajectory.
std::size_t mNumLineSegments
Number of line segments of the discretized task-space trajectory.
Definition: TrajectoryMarker.hpp:126
bool mNeedUpdate
Whether the associated RViz maker needs to be updated.
Definition: TrajectoryMarker.hpp:138
double getThickness() const
Returns thickness of visualized trajectory.
dart::dynamics::MetaSkeletonPtr mSkeleton
Target DART meta skeleton that the C-space trajectory will be applied to compute the visualizing task...
Definition: TrajectoryMarker.hpp:132
std::string mFrameId
Frame name of RViz interactive marker.
Definition: TrajectoryMarker.hpp:120
void update()
Updates this marker.
trajectory::ConstTrajectoryPtr getTrajectory() const
Returns trajectory associated with this marker.
double getAlpha() const
Returns alpha of visualized trajectory.
TrajectoryMarker(interactive_markers::InteractiveMarkerServer *markerServer, const std::string &frameId, const std::string &markerName, trajectory::ConstTrajectoryPtr trajectory, dart::dynamics::MetaSkeletonPtr skeleton, const dart::dynamics::Frame &frame, const Eigen::Vector4d &rgba=Eigen::Vector4d::Constant(0.75), double thickness=0.01, std::size_t numLineSegments=16u)
Constructor.
void setColor(const Eigen::Vector3d &rgb)
Sets or updates color (RGB) of visualized trajectory.
void setRGBA(const Eigen::Vector4d &rgb)
Sets or updates RGBA of visualized trajectory.
void setThickness(double thickness)
Sets or updates thickness of visualized trajectory.
~TrajectoryMarker()
Destructor.
#define AIKIDO_DECLARE_POINTERS(X)
Definition: pointers.hpp:21
const dart::dynamics::Frame & mFrame
Target DART frame where the trajectory of its origin will be visualized.
Definition: TrajectoryMarker.hpp:135
void updatePoints()
Updates trajectory points based on trajectory and number of line-segments.