GithubHelp home page GithubHelp logo

Comments (5)

fmrico avatar fmrico commented on September 25, 2024

Hi @hyunoklee

This software has one limitation: you must use a framework whose X-axis is oriented towards the scene.

I would use base_footprint as the working frame, and transform the center to "map", with something like this (I have not compiled this!!!, use it only as reference):

// The input is BoundingBoxes3d msg;

BoundingBox3d point_msg = msg[0];
tf2::Vector3 point;

point.setX( (point_msg.xmax + point_msg.xmin) / 2.0 );
point.setY( (point_msg.ymax + point_msg.ymin) / 2.0 );
point.setZ( (point_msg.zmax + point_msg.zmin) / 2.0 );

geometry_msgs::TransformStamped p2map_msg;
tf2::Transform p2map;

std::string error;
if (tfBuffer_.canTransform(point_msg.header.frame_id, "map", ros::Time(0), ros::Duration(0.1), &error))
	p2map_msg = tfBuffer_.lookupTransform(point_msg.header.frame_id, "map", ros::Time(0));
else
{
        ROS_ERROR("Can't transform %s", error.c_str());
	return;
}

tf2::convert(p2map_msg, p2map);

tf2::Vector3 point_in_map = (p2map).inverse() * point;

Hope it helps!!!

from gb_visual_detection_3d.

hyunoklee avatar hyunoklee commented on September 25, 2024

thank you ~

from gb_visual_detection_3d.

gokcesena avatar gokcesena commented on September 25, 2024

Hi @fmrico, in which part should I integrate this code? Darknet3d.cpp or darknet3DListener.cpp?

from gb_visual_detection_3d.

fmrico avatar fmrico commented on September 25, 2024

@fgonzalezr1998 ?

from gb_visual_detection_3d.

fgonzalezr1998 avatar fgonzalezr1998 commented on September 25, 2024

Hello, @gokcesena . I supose you have a node which subscribes to the darknet_ros_3d output. You only need to add some code to that node in order to transform the x,y,z coordinates to the map frame. You should use tf or tf2.

To sum up, the coordinates of the 3d bounding boxes can be changed to any frame AFTER their calculation (many documentation about coordinates transformation is available on internet), so don't change de working_frame parameter of the yaml file.

from gb_visual_detection_3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.