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;
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
add a comment |
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
@stovfl, thanks for your edition
– evbo
Mar 24 at 2:43
add a comment |
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
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
python ros rospy
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
add a comment |
@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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Apr 6 at 12:09
PeteBlackerThe3rdPeteBlackerThe3rd
626
626
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
@stovfl, thanks for your edition
– evbo
Mar 24 at 2:43