Hi everybody,
I am working on a drone project I’m connecting ros to gazebo and using the mavros node of course. I would like to publish position messages to /mavros/setpoint_position/global topic and at the same time I’m trying to adjust the velocity with which the drone goes to the intended position using the /mavros/setpoint_velocity/cmd_vel, but it doesn’t work together. I think the problem is in the setpoint_position.cpp in this method:
void setpointg_cb(const geographic_msgs::GeoPoseStamped::ConstPtr &req)
{
using mavlink::common::POSITION_TARGET_TYPEMASK;
uint16_t type_mask = uint16_t(POSITION_TARGET_TYPEMASK::VX_IGNORE)
| uint16_t(POSITION_TARGET_TYPEMASK::VY_IGNORE)
| uint16_t(POSITION_TARGET_TYPEMASK::VZ_IGNORE)
| uint16_t(POSITION_TARGET_TYPEMASK::AX_IGNORE)
| uint16_t(POSITION_TARGET_TYPEMASK::AY_IGNORE)
| uint16_t(POSITION_TARGET_TYPEMASK::AZ_IGNORE);
Eigen::Quaterniond attitude;
tf::quaternionMsgToEigen(req->pose.orientation, attitude);
Eigen::Quaterniond q = ftf::transform_orientation_enu_ned(
ftf::transform_orientation_baselink_aircraft(attitude));
set_position_target_global_int(
req->header.stamp.toNSec() / 1000000,
uint8_t(MAV_FRAME::GLOBAL_INT),
type_mask,
req->pose.position.latitude * 1e7,
req->pose.position.longitude * 1e7,
req->pose.position.altitude,
Eigen::Vector3d::Zero(),
Eigen::Vector3d::Zero(),
ftf::quaternion_get_yaw(q),
0); }
As I believe that this bit masking ignores the velocity change effects.
Thank you in advance.