Skip to content

Commit

Permalink
Imported upstream version '1.20.0' of 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
vooon committed Oct 10, 2024
1 parent 124215a commit e668bfb
Show file tree
Hide file tree
Showing 19 changed files with 101 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dependencies.rosinstall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- git:
local-name: mavlink
uri: https://github.com/mavlink/mavlink-gbp-release.git
version: release/kinetic/mavlink
version: release/noetic/mavlink
3 changes: 3 additions & 0 deletions libmavconn/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package libmavconn
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.20.0 (2024-10-10)
-------------------

1.19.0 (2024-06-06)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion libmavconn/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>libmavconn</name>
<version>1.19.0</version>
<version>1.20.0</version>
<description>
MAVLink communication library.
This library provide unified connection handling classes
Expand Down
6 changes: 6 additions & 0 deletions mavros/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog for package mavros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.20.0 (2024-10-10)
-------------------
* add param to odom plugin
* add frame_id parameter
* Contributors: EnderMandS

1.19.0 (2024-06-06)
-------------------
* gps_global_origin: remove LLA to ECEF conversion
Expand Down
22 changes: 22 additions & 0 deletions mavros/include/mavros/mavros_uas.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,26 @@ class UAS {
*/
bool cmode_from_str(std::string cmode_str, uint32_t &custom_mode);

inline void set_base_link_frame_id(const std::string frame_id) {
base_link_frame_id = frame_id;
}
inline void set_odom_frame_id(const std::string frame_id) {
odom_frame_id = frame_id;
}
inline void set_map_frame_id(const std::string frame_id) {
map_frame_id = frame_id;
}
inline std::string get_base_link_frame_id() {
return base_link_frame_id;
}
inline std::string get_odom_frame_id() {
return odom_frame_id;
}
inline std::string get_map_frame_id() {
return map_frame_id;
}
void setup_static_tf();

private:
std::recursive_mutex mutex;

Expand Down Expand Up @@ -472,5 +492,7 @@ class UAS {

std::atomic<bool> fcu_caps_known;
std::atomic<uint64_t> fcu_capabilities;

std::string base_link_frame_id, odom_frame_id, map_frame_id;
};
} // namespace mavros
3 changes: 2 additions & 1 deletion mavros/launch/px4_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ mount:
# odom
odometry:
fcu:
odom_parent_id_des: "map" # desired parent frame rotation of the FCU's odometry
odom_parent_id_des: "odom" # desired parent frame rotation of the FCU's odometry
odom_child_id_des: "base_link" # desired child frame rotation of the FCU's odometry
map_id_des: "map"

# px4flow
px4flow:
Expand Down
2 changes: 1 addition & 1 deletion mavros/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>mavros</name>
<version>1.19.0</version>
<version>1.20.0</version>
<description>
MAVROS -- MAVLink extendable communication node for ROS
with proxy for Ground Control Station.
Expand Down
13 changes: 13 additions & 0 deletions mavros/src/lib/mavros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ MavRos::MavRos() :
nh.getParam("plugin_blacklist", plugin_blacklist);
nh.getParam("plugin_whitelist", plugin_whitelist);

// Get frame_id
std::string base_link_frame_id, odom_frame_id, map_frame_id;
if (nh.param<std::string>("base_link_frame_id", base_link_frame_id, "base_link"))
ROS_INFO("Find param base_link_frame_id: %s", base_link_frame_id.c_str());
if (nh.param<std::string>("odom_frame_id", odom_frame_id, "odom"))
ROS_INFO("Find param odom_frame_id: %s", odom_frame_id.c_str());
if (nh.param<std::string>("map_frame_id", map_frame_id, "map"))
ROS_INFO("Find param map_frame_id: %s", map_frame_id.c_str());
mav_uas.set_base_link_frame_id(base_link_frame_id);
mav_uas.set_odom_frame_id(odom_frame_id);
mav_uas.set_map_frame_id(map_frame_id);
mav_uas.setup_static_tf();

conn_timeout = ros::Duration(conn_timeout_d);

// Now we use FCU URL as a hardware Id
Expand Down
23 changes: 14 additions & 9 deletions mavros/src/lib/uas_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ UAS::UAS() :
time_offset(0),
tsync_mode(UAS::timesync_mode::NONE),
fcu_caps_known(false),
fcu_capabilities(0)
fcu_capabilities(0),
base_link_frame_id("base_link"),
odom_frame_id("odom"),
map_frame_id("map")
{
try {
// Using smallest dataset with 5' grid,
Expand All @@ -50,14 +53,6 @@ UAS::UAS() :
" | Run install_geographiclib_dataset.sh script in order to install Geoid Model dataset!");
ros::shutdown();
}

// Publish helper TFs used for frame transformation in the odometry plugin
std::vector<geometry_msgs::TransformStamped> transform_vector;
add_static_transform("map", "map_ned", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, M_PI_2)),transform_vector);
add_static_transform("odom", "odom_ned", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, M_PI_2)),transform_vector);
add_static_transform("base_link", "base_link_frd", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, 0)),transform_vector);

tf2_static_broadcaster.sendTransform(transform_vector);
}

/* -*- heartbeat handlers -*- */
Expand Down Expand Up @@ -275,3 +270,13 @@ void UAS::publish_static_transform(const std::string &frame_id, const std::strin

tf2_static_broadcaster.sendTransform(static_transformStamped);
}

//! Publish helper TFs used for frame transformation in the odometry plugin
void UAS::setup_static_tf()
{
std::vector<geometry_msgs::TransformStamped> transform_vector;
add_static_transform(map_frame_id, map_frame_id+"_ned", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, M_PI_2)),transform_vector);
add_static_transform(odom_frame_id, odom_frame_id+"_ned", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, M_PI_2)),transform_vector);
add_static_transform(base_link_frame_id, base_link_frame_id+"_frd", Eigen::Affine3d(ftf::quaternion_from_rpy(M_PI, 0, 0)),transform_vector);
tf2_static_broadcaster.sendTransform(transform_vector);
}
10 changes: 10 additions & 0 deletions mavros_extras/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Changelog for package mavros_extras
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.20.0 (2024-10-10)
-------------------
* Add missing std_srvs dependency
* add param to odom plugin
* add frame_id parameter
* Fix compile error when compiling with gcc 13
The error is:
src/plugins/mag_calibration_status.cpp:64:22: error: ‘bitset’ is not a member of ‘std’
* Contributors: EnderMandS, Michal Sojka, Roland Arsenault

1.19.0 (2024-06-06)
-------------------

Expand Down
1 change: 1 addition & 0 deletions mavros_extras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ find_package(catkin REQUIRED COMPONENTS
roscpp
sensor_msgs
std_msgs
std_srvs
tf
tf2_eigen
urdf
Expand Down
3 changes: 2 additions & 1 deletion mavros_extras/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>mavros_extras</name>
<version>1.19.0</version>
<version>1.20.0</version>
<description>
Extra nodes and plugins for <a href="http://wiki.ros.org/mavros">MAVROS</a>.
</description>
Expand All @@ -26,6 +26,7 @@
<depend>mavros_msgs</depend>
<depend>sensor_msgs</depend>
<depend>std_msgs</depend>
<depend>std_srvs</depend>
<depend>visualization_msgs</depend>
<depend>urdf</depend>
<depend>tf</depend>
Expand Down
2 changes: 2 additions & 0 deletions mavros_extras/src/plugins/mag_calibration_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <mavros/mavros_plugin.h>
#include <std_msgs/UInt8.h>
#include <mavros_msgs/MagnetometerReporter.h>
#include <bitset>

namespace mavros {
namespace std_plugins {
/**
Expand Down
19 changes: 11 additions & 8 deletions mavros_extras/src/plugins/odom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class OdometryPlugin : public plugin::PluginBase {

OdometryPlugin() : PluginBase(),
odom_nh("~odometry"),
fcu_odom_parent_id_des("map"),
fcu_map_id_des("map"),
fcu_odom_parent_id_des("odom"),
fcu_odom_child_id_des("base_link")
{ }

Expand All @@ -56,8 +57,9 @@ class OdometryPlugin : public plugin::PluginBase {
PluginBase::initialize(uas_);

// frame params:
odom_nh.param<std::string>("fcu/odom_parent_id_des", fcu_odom_parent_id_des, "map");
odom_nh.param<std::string>("fcu/odom_child_id_des", fcu_odom_child_id_des, "base_link");
odom_nh.param<std::string>("fcu/odom_parent_id_des", fcu_odom_parent_id_des, uas_.get_odom_frame_id());
odom_nh.param<std::string>("fcu/odom_child_id_des", fcu_odom_child_id_des, uas_.get_base_link_frame_id());
odom_nh.param<std::string>("fcu/map_id_des", fcu_map_id_des, uas_.get_map_frame_id());

// publishers
odom_pub = odom_nh.advertise<nav_msgs::Odometry>("in", 10);
Expand All @@ -80,6 +82,7 @@ class OdometryPlugin : public plugin::PluginBase {

std::string fcu_odom_parent_id_des; //!< desired orientation of the fcu odometry message's parent frame
std::string fcu_odom_child_id_des; //!< desired orientation of the fcu odometry message's child frame
std::string fcu_map_id_des; //!< desired orientation of the fcu map frame

/**
* @brief Lookup static transform with error handling
Expand Down Expand Up @@ -122,8 +125,8 @@ class OdometryPlugin : public plugin::PluginBase {
Eigen::Affine3d tf_parent2parent_des;
Eigen::Affine3d tf_child2child_des;

lookup_static_transform(fcu_odom_parent_id_des, "map_ned", tf_parent2parent_des);
lookup_static_transform( fcu_odom_child_id_des, "base_link_frd", tf_child2child_des);
lookup_static_transform(fcu_map_id_des, fcu_map_id_des+"_ned", tf_parent2parent_des);
lookup_static_transform( fcu_odom_child_id_des, fcu_odom_child_id_des+"_frd", tf_child2child_des);

//! Build 6x6 pose covariance matrix to be transformed and sent
Matrix6d cov_pose = Matrix6d::Zero();
Expand All @@ -142,7 +145,7 @@ class OdometryPlugin : public plugin::PluginBase {

auto odom = boost::make_shared<nav_msgs::Odometry>();

odom->header = m_uas->synchronized_header(fcu_odom_parent_id_des, odom_msg.time_usec);
odom->header = m_uas->synchronized_header(fcu_map_id_des, odom_msg.time_usec);
odom->child_frame_id = fcu_odom_child_id_des;

/**
Expand Down Expand Up @@ -203,8 +206,8 @@ class OdometryPlugin : public plugin::PluginBase {
Eigen::Affine3d tf_parent2parent_des;
Eigen::Affine3d tf_child2child_des;

lookup_static_transform("odom_ned", odom->header.frame_id, tf_parent2parent_des);
lookup_static_transform("base_link_frd", odom->child_frame_id, tf_child2child_des);
lookup_static_transform(fcu_odom_parent_id_des+"_ned", odom->header.frame_id, tf_parent2parent_des);
lookup_static_transform(fcu_odom_child_id_des+"_frd", odom->child_frame_id, tf_child2child_des);

//! Build 6x6 pose covariance matrix to be transformed and sent
ftf::Covariance6d cov_pose = odom->pose.covariance;
Expand Down
8 changes: 4 additions & 4 deletions mavros_extras/src/plugins/wheel_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ class WheelOdometryPlugin : public plugin::PluginBase {

// Odometry params
wo_nh.param("send_twist", twist_send, false);
wo_nh.param<std::string>("frame_id", frame_id, "odom");
wo_nh.param<std::string>("child_frame_id", child_frame_id, "base_link");
wo_nh.param<std::string>("frame_id", frame_id, uas_.get_odom_frame_id());
wo_nh.param<std::string>("child_frame_id", child_frame_id, uas_.get_base_link_frame_id());
wo_nh.param("vel_error", vel_cov, 0.1);
vel_cov = vel_cov * vel_cov; // std -> cov
// TF subsection
wo_nh.param("tf/send", tf_send, false);
wo_nh.param<std::string>("tf/frame_id", tf_frame_id, "odom");
wo_nh.param<std::string>("tf/child_frame_id", tf_child_frame_id, "base_link");
wo_nh.param<std::string>("tf/frame_id", tf_frame_id, uas_.get_odom_frame_id());
wo_nh.param<std::string>("tf/child_frame_id", tf_child_frame_id, uas_.get_base_link_frame_id());

// Read parameters for each wheel.
{
Expand Down
3 changes: 3 additions & 0 deletions mavros_msgs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package mavros_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.20.0 (2024-10-10)
-------------------

1.19.0 (2024-06-06)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion mavros_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>mavros_msgs</name>
<version>1.19.0</version>
<version>1.20.0</version>
<description>
mavros_msgs defines messages for <a href="http://wiki.ros.org/mavros">MAVROS</a>.
</description>
Expand Down
3 changes: 3 additions & 0 deletions test_mavros/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package test_mavros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.20.0 (2024-10-10)
-------------------

1.19.0 (2024-06-06)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion test_mavros/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>test_mavros</name>
<version>1.19.0</version>
<version>1.20.0</version>
<description>Tests for MAVROS package</description>

<maintainer email="[email protected]">Vladimir Ermakov</maintainer>
Expand Down

0 comments on commit e668bfb

Please sign in to comment.