-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visualize height of UAV (both esitamted state and ground truth) in rv…
…iz and modify the config of rviz about task1 and task3
- Loading branch information
Showing
6 changed files
with
340 additions
and
7 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
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
88 changes: 88 additions & 0 deletions
88
jsk_mbzirc_tasks/include/jsk_mbzirc_tasks/mbzirc_gazebo_uav_state_display_plugin.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,88 @@ | ||
/* | ||
* Copyright (c) 2016, JSK Robotics Laboratory, The University of Tokyo | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* * Neither the name of the Willow Garage, Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef JSK_MBZIRC_TASKS_MBZIRC_GAZEBO_UAV_STATE_DISPLAY_PLUGIN_H | ||
#define JSK_MBZIRC_TASKS_MBZIRC_GAZEBO_UAV_STATE_DISPLAY_PLUGIN_H | ||
|
||
#include <gazebo/common/Plugin.hh> | ||
#include <gazebo/common/Time.hh> | ||
#include <gazebo/math/Quaternion.hh> | ||
#include <gazebo/common/Events.hh> | ||
#include <gazebo/physics/physics.hh> | ||
|
||
// ROS | ||
#include <ros/ros.h> | ||
#include <ros/callback_queue.h> | ||
|
||
#include <nav_msgs/Odometry.h> | ||
#include <std_msgs/String.h> | ||
|
||
// Boost | ||
#include <boost/thread.hpp> | ||
#include <boost/bind.hpp> | ||
|
||
#include <cmath> | ||
#include <string> | ||
|
||
namespace gazebo | ||
{ | ||
class GazeboUavState : public ModelPlugin | ||
{ | ||
public: | ||
GazeboUavState(); | ||
virtual ~GazeboUavState(); | ||
|
||
protected: | ||
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf); | ||
virtual void Update(); | ||
|
||
private: | ||
ros::NodeHandle* node_handle_; | ||
|
||
ros::Subscriber state_sub_, ground_truth_sub_; | ||
ros::Publisher string_state_pub_, string_ground_truth_pub_; | ||
|
||
ros::CallbackQueue callback_queue_; | ||
event::ConnectionPtr update_connection_; | ||
|
||
physics::WorldPtr world_; | ||
physics::LinkPtr link_; | ||
std::string link_name_; | ||
|
||
std::string state_topic_, ground_truth_topic_; | ||
|
||
// parameters | ||
std::string robot_name_space_; | ||
|
||
void stateCallback(const nav_msgs::OdometryConstPtr&); | ||
void groundTruthCallback(const nav_msgs::OdometryConstPtr&); | ||
}; | ||
} // namespace gazebo | ||
|
||
#endif // JSK_MBZIRC_TASKS_MBZIRC_GAZEBO_UAV_STATE_DISPLAY_PLUGIN_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
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.