how to show ros marker in python?How do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonHow can I safely create a nested directory in Python?How to return multiple values from a function?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?

Create a list of all possible Boolean configurations of three constraints

How to compact two the parabol commands in the following example?

Drawing lines to nearest point

Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?

Size of a folder with du

Can I see all locations that a DMG file install files to?

Why was Endgame Thanos so different than Infinity War Thanos?

What does a comma mean inside an 'if' statement?

What stroke width Instagram is using for its icons and how to get same results?

How does noise-cancellation work in Mac laptops?

Front derailleur hard to move due to gear cable angle

Can I use my laptop, which says 100-240V, in the USA?

Meaning of「〜てみたいと思います」

SSD - Disk is OK, one bad sector

How can Thor be worthy?

Why was the Ancient One so hesitant to teach Dr. Strange the art of sorcery?

How does Howard Stark know this?

Run script for 10 times until meets the condition, but break the loop if it meets the condition during iteration

Is the schwa sound consistent?

Why not just directly invest in the holdings of an ETF?

What to do if SUS scores contradict qualitative feedback?

How do I tell my supervisor that he is choosing poor replacements for me while I am on maternity leave?

Why doesn't Rocket Lab use a solid stage?

Make all the squares explode



how to show ros marker in python?


How do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonHow can I safely create a nested directory in Python?How to return multiple values from a function?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I want to show a 3D bbox in ROS with Python. I have the 3d bbox coordinates, and I want to use a marker to show. However, I added some points which were the corner coordinate to the marker and published them, but I didn't see the bbox, what's wrong with my code?



Here is my code:



markers = MarkerArray() 
for i in range(len(self.bbox_data)):
marker = Marker(type=Marker.LINE_LIST,ns='velodyne', action=Marker.ADD)
marker.header.frame_id = "velodyne"
marker.header.stamp = rospy.Time.now()
if self.bbox_data[i][0][0] == frame:

for n in range(8):
point = geom_msg.Point(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][1])
marker.points.append(point)

marker.scale.x = 0.02
marker.lifetime = rospy.Duration.from_sec(0.1)
marker.color.a = 1.0
marker.color.r = 0.5
marker.color.g = 0.5
marker.color.b = 0.5
markers.markers.append(marker)

self.bbox.publish(markers)


where



(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][2])


is



(x,y,z)









share|improve this question
























  • @stovfl, thanks for your edition

    – evbo
    Mar 24 at 2:43


















1















I want to show a 3D bbox in ROS with Python. I have the 3d bbox coordinates, and I want to use a marker to show. However, I added some points which were the corner coordinate to the marker and published them, but I didn't see the bbox, what's wrong with my code?



Here is my code:



markers = MarkerArray() 
for i in range(len(self.bbox_data)):
marker = Marker(type=Marker.LINE_LIST,ns='velodyne', action=Marker.ADD)
marker.header.frame_id = "velodyne"
marker.header.stamp = rospy.Time.now()
if self.bbox_data[i][0][0] == frame:

for n in range(8):
point = geom_msg.Point(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][1])
marker.points.append(point)

marker.scale.x = 0.02
marker.lifetime = rospy.Duration.from_sec(0.1)
marker.color.a = 1.0
marker.color.r = 0.5
marker.color.g = 0.5
marker.color.b = 0.5
markers.markers.append(marker)

self.bbox.publish(markers)


where



(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][2])


is



(x,y,z)









share|improve this question
























  • @stovfl, thanks for your edition

    – evbo
    Mar 24 at 2:43














1












1








1


1






I want to show a 3D bbox in ROS with Python. I have the 3d bbox coordinates, and I want to use a marker to show. However, I added some points which were the corner coordinate to the marker and published them, but I didn't see the bbox, what's wrong with my code?



Here is my code:



markers = MarkerArray() 
for i in range(len(self.bbox_data)):
marker = Marker(type=Marker.LINE_LIST,ns='velodyne', action=Marker.ADD)
marker.header.frame_id = "velodyne"
marker.header.stamp = rospy.Time.now()
if self.bbox_data[i][0][0] == frame:

for n in range(8):
point = geom_msg.Point(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][1])
marker.points.append(point)

marker.scale.x = 0.02
marker.lifetime = rospy.Duration.from_sec(0.1)
marker.color.a = 1.0
marker.color.r = 0.5
marker.color.g = 0.5
marker.color.b = 0.5
markers.markers.append(marker)

self.bbox.publish(markers)


where



(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][2])


is



(x,y,z)









share|improve this question
















I want to show a 3D bbox in ROS with Python. I have the 3d bbox coordinates, and I want to use a marker to show. However, I added some points which were the corner coordinate to the marker and published them, but I didn't see the bbox, what's wrong with my code?



Here is my code:



markers = MarkerArray() 
for i in range(len(self.bbox_data)):
marker = Marker(type=Marker.LINE_LIST,ns='velodyne', action=Marker.ADD)
marker.header.frame_id = "velodyne"
marker.header.stamp = rospy.Time.now()
if self.bbox_data[i][0][0] == frame:

for n in range(8):
point = geom_msg.Point(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][1])
marker.points.append(point)

marker.scale.x = 0.02
marker.lifetime = rospy.Duration.from_sec(0.1)
marker.color.a = 1.0
marker.color.r = 0.5
marker.color.g = 0.5
marker.color.b = 0.5
markers.markers.append(marker)

self.bbox.publish(markers)


where



(self.bbox_data[i][n+1][0],self.bbox_data[i][n+1][1],self.bbox_data[i][n+1][2])


is



(x,y,z)






python ros rospy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 1 at 17:03









Benyamin Jafari

4,12652755




4,12652755










asked Mar 23 at 12:01









evboevbo

478




478












  • @stovfl, thanks for your edition

    – evbo
    Mar 24 at 2:43


















  • @stovfl, thanks for your edition

    – evbo
    Mar 24 at 2:43

















@stovfl, thanks for your edition

– evbo
Mar 24 at 2:43






@stovfl, thanks for your edition

– evbo
Mar 24 at 2:43













1 Answer
1






active

oldest

votes


















0














When you say




but I didn't see the bbox




what exactly do you mean? Do you see nothing at all or just a couple of parallel lines or something else?



There is one small bug in your code creating the point message. You're adding the x, y, y values instead of x, y, z.



However you're also not creating a set of lines describing the bounding box correctly. The bbox_data appears to list the 8 corner points of the bounding box, you need to define the 12 edge lines connecting these points so they're drawn in RVIZ. The line_list marker needs two points to define each line, since There is no simple algorithm to match the 8 points to the 24 start and end points you need to add to the marker msg, so you may have to hard code that part.



These two bugs may well be combining in such a way that you don't see anything on screen, but hopefully this will help you fix it.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313518%2fhow-to-show-ros-marker-in-python%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    When you say




    but I didn't see the bbox




    what exactly do you mean? Do you see nothing at all or just a couple of parallel lines or something else?



    There is one small bug in your code creating the point message. You're adding the x, y, y values instead of x, y, z.



    However you're also not creating a set of lines describing the bounding box correctly. The bbox_data appears to list the 8 corner points of the bounding box, you need to define the 12 edge lines connecting these points so they're drawn in RVIZ. The line_list marker needs two points to define each line, since There is no simple algorithm to match the 8 points to the 24 start and end points you need to add to the marker msg, so you may have to hard code that part.



    These two bugs may well be combining in such a way that you don't see anything on screen, but hopefully this will help you fix it.






    share|improve this answer



























      0














      When you say




      but I didn't see the bbox




      what exactly do you mean? Do you see nothing at all or just a couple of parallel lines or something else?



      There is one small bug in your code creating the point message. You're adding the x, y, y values instead of x, y, z.



      However you're also not creating a set of lines describing the bounding box correctly. The bbox_data appears to list the 8 corner points of the bounding box, you need to define the 12 edge lines connecting these points so they're drawn in RVIZ. The line_list marker needs two points to define each line, since There is no simple algorithm to match the 8 points to the 24 start and end points you need to add to the marker msg, so you may have to hard code that part.



      These two bugs may well be combining in such a way that you don't see anything on screen, but hopefully this will help you fix it.






      share|improve this answer

























        0












        0








        0







        When you say




        but I didn't see the bbox




        what exactly do you mean? Do you see nothing at all or just a couple of parallel lines or something else?



        There is one small bug in your code creating the point message. You're adding the x, y, y values instead of x, y, z.



        However you're also not creating a set of lines describing the bounding box correctly. The bbox_data appears to list the 8 corner points of the bounding box, you need to define the 12 edge lines connecting these points so they're drawn in RVIZ. The line_list marker needs two points to define each line, since There is no simple algorithm to match the 8 points to the 24 start and end points you need to add to the marker msg, so you may have to hard code that part.



        These two bugs may well be combining in such a way that you don't see anything on screen, but hopefully this will help you fix it.






        share|improve this answer













        When you say




        but I didn't see the bbox




        what exactly do you mean? Do you see nothing at all or just a couple of parallel lines or something else?



        There is one small bug in your code creating the point message. You're adding the x, y, y values instead of x, y, z.



        However you're also not creating a set of lines describing the bounding box correctly. The bbox_data appears to list the 8 corner points of the bounding box, you need to define the 12 edge lines connecting these points so they're drawn in RVIZ. The line_list marker needs two points to define each line, since There is no simple algorithm to match the 8 points to the 24 start and end points you need to add to the marker msg, so you may have to hard code that part.



        These two bugs may well be combining in such a way that you don't see anything on screen, but hopefully this will help you fix it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 6 at 12:09









        PeteBlackerThe3rdPeteBlackerThe3rd

        626




        626





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313518%2fhow-to-show-ros-marker-in-python%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현