PacktPublishing / Learn-Robotics-Programming

Learn Robotics - Fundamentals of Robotics Programming, published by Packt
MIT License
40 stars 14 forks source link

Problem with color_track_behavior.py #4

Closed Onydus closed 3 years ago

Onydus commented 4 years ago

Hello again, Danny

I hope you are well.

My apologies for bothering you again. I'm sure you have better things to do. However, I've come across a bit of a road block while working through this section of your book.

This is the error message being outputted into the console:

color_tracking

Again, resorting to copying the code directly from github, the only edit I have made to the original is this: "contours = cv2.findContours(contour_image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[0]" Suggested by you to a fellow reader on the raspberrypi forum.

I'm completely stumped.

Kind regards, Onydus

dannystaple commented 4 years ago

Hello, first - it doesn't bother me to have book queries and inquiries. It's all good material to create an FAQ or improve things in follow-up books.

The callback set to none warning is unrelated to this- this is the cleanup code.

So I'm assuming this is the visual processing area. The OpenCV API has changed between the version I'd installed in the original book and now.

This code seems to work with a current version of OpenCV:

  contours = cv2.findContours(masked, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[0]
  circles = [cv2.minEnclosingCircle(cnt) for cnt in contours]

Some questions so I can try to reproduce this:

Onydus commented 4 years ago

Danny,

My apologies for the delayed response. I've been called away abroad on business and didn't want to risk bringing my robot with me (could look suspicious to the uninitiated eye in airport security). As soon as I'm home I'll be getting back into it and implementing your updated code and answering your questions. Again, my apologies, I wasn't expecting to be stuck over here for so long! Thank you for your time.

Hope you and your family are well.

Kind regards, Onydus

Get Outlook for Androidhttps://aka.ms/ghei36


From: Danny Staple notifications@github.com Sent: Tuesday, July 21, 2020 11:12:53 AM To: PacktPublishing/Learn-Robotics-Programming Learn-Robotics-Programming@noreply.github.com Cc: Onydus rowan_hansard@hotmail.co.uk; Author author@noreply.github.com Subject: Re: [PacktPublishing/Learn-Robotics-Programming] Problem with color_track_behavior.py (#4)

Hello, first - it doesn't bother me to have book queries and inquiries. It's all good material to create an FAQ or improve things in follow-up books.

The callback set to none warning is unrelated to this- this is the cleanup code.

So I'm assuming this is the visual processing area. The OpenCV API has changed between the version I'd installed in the original book and now.

This code seems to work with a current version of OpenCV:

contours = cv2.findContours(masked, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[0] circles = [cv2.minEnclosingCircle(cnt) for cnt in contours]

Some questions so I can try to reproduce this:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPacktPublishing%2FLearn-Robotics-Programming%2Fissues%2F4%23issuecomment-661767342&data=02%7C01%7C%7Cbd28e392079546647fa208d82d5ea21a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637309231745748322&sdata=fdFRO%2FOkFpIpIgx5yErUYSRK%2FJZpfcpOXUfiiyvX%2FZw%3D&reserved=0, or unsubscribehttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANV7NCTY5TPOPDPLNWTZY2TR4VS2LANCNFSM4PBLZE4Q&data=02%7C01%7C%7Cbd28e392079546647fa208d82d5ea21a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637309231745758318&sdata=8zkWT0WHkeSFCGotYTKDb8FEWI%2FeFSrXm6sSfAHzU1A%3D&reserved=0.

Onydus commented 3 years ago

Danny,

I'm truly sorry that I was unable to reply to your questions regarding my robot issues. It's been a crazy time, unfortunately, as you're aware, I'm sure. I want to let you know that I really appreciate the time you spent helping me. Thank you.

All the best, Onydus

Get Outlook for Androidhttps://aka.ms/ghei36


From: packt-pradeeps notifications@github.com Sent: Tuesday, February 23, 2021 1:34:45 PM To: PacktPublishing/Learn-Robotics-Programming Learn-Robotics-Programming@noreply.github.com Cc: Onydus rowan_hansard@hotmail.co.uk; Author author@noreply.github.com Subject: Re: [PacktPublishing/Learn-Robotics-Programming] Problem with color_track_behavior.py (#4)

Closed #4https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPacktPublishing%2FLearn-Robotics-Programming%2Fissues%2F4&data=04%7C01%7C%7C407c5bc2216c41ae201a08d8d7ffc8e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637496840866870243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Nf4zQt%2FUoH0LtcgSUXfInh2NLpgzHNtnDXaVp54RNLY%3D&reserved=0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPacktPublishing%2FLearn-Robotics-Programming%2Fissues%2F4%23event-4365193320&data=04%7C01%7C%7C407c5bc2216c41ae201a08d8d7ffc8e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637496840866870243%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OOW9IjVvoinuami%2FcYLRbt4xiOyjS6oIqw4emXEK%2FpA%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANV7NCUSGFVHIJBKH6G5IGTTAOVHLANCNFSM4PBLZE4Q&data=04%7C01%7C%7C407c5bc2216c41ae201a08d8d7ffc8e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637496840866880237%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=o4eQa92pACo6dZ8Ico24H0jHcdocuvCBUUROBL0hs4A%3D&reserved=0.

dannystaple commented 3 years ago

Hello Onydus,

Did you manage to get the updated code to work on the robot? Have you done any robotics projects since? I hope things have settled a bit more now! It was a strange year or so for us all!

Danny

Onydus commented 3 years ago

Hey Danny,

It's good to hear from you again. I'm sorry but I got distracted with another robot, and didn't get around to updating the code yet! Thanks to what I learned from you I was able to build this one! (see attached). As before, I got even more creative with the 3D printers! Haha This one sanitises floors for my local taekwondo gym. I've named it Temple Keeper so far. I've also built a robot wars spec 'robot' to cut my lawn. It currently wants to do 12mph all the time but I just can't bring myself to dial down in the motor speeds :') I'd like to thank you again for your help, and the inspiration your book gave me on my journey in robotics. I was even able to use my projects to convince a university to let me onto their robotics degree course. I start tomorrow 😄

It was indeed a strange and crazy period.

I hope you are doing well. What have you been working on? Any more books in the pipeline? I'm always on the lookout for some good books on the subject.

Kind regards, Onydus (Rowan Hansard)


From: Danny Staple @.> Sent: 31 August 2021 10:28 To: PacktPublishing/Learn-Robotics-Programming @.> Cc: Onydus @.>; Author @.> Subject: Re: [PacktPublishing/Learn-Robotics-Programming] Problem with color_track_behavior.py (#4)

Hello Onydus,

Did you manage to get the updated code to work on the robot? Have you done any robotics projects since? I hope things have settled a bit more now! It was a strange year or so for us all!

Danny

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FPacktPublishing%2FLearn-Robotics-Programming%2Fissues%2F4%23issuecomment-909108723&data=04%7C01%7C%7Cbfa27daa52f84ff80e4008d96c6a25ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637660025417278579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q7u0DXhnRGRnJaCbjSsDIaxWPVPUVtDyo5Ffy0liZlE%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANV7NCWHVXXO5CNMKT6OPV3T7SVGXANCNFSM4PBLZE4Q&data=04%7C01%7C%7Cbfa27daa52f84ff80e4008d96c6a25ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637660025417278579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=j5GPj2pudNfdk8LdRa2KIQCGOm69YN5mHAGLHDFQU5o%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Cbfa27daa52f84ff80e4008d96c6a25ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637660025417288572%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fSD0DEC3cHadTRY3wBAdhQpYMUBttrK6li3xBrNE4aU%3D&reserved=0 or Androidhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Cbfa27daa52f84ff80e4008d96c6a25ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637660025417288572%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LIBf6iZA7N3yEtZJODB8d8OrmmMHJxbgJ%2FoiXjZQCNE%3D&reserved=0.

dannystaple commented 3 years ago

Hi Onydus, That sounds interesting indeed - any links or photos of it? I didn't get the attachment there. 3D printers are such an awesome addition to making robots - I use mine a lot, although not for book robots, as the concern there is how much of the audience have access to them. I want to make a book focusing on 3D printable robot projects one day though. Hexapods, arms, heads, hands and so on.

Robotics degree course! Amazing!

I am working on a 3rd book - this time a Raspberry Pi Pico robotics book and trying for a faster-paced style. Just hope it won't make it harder to follow, although it's aimed at a reader who has done a little more than the first book. I'll be putting in a chapter skimming FreeCAD design, which is turning out to be quite tricky (and may need more than one chapter) - just to kickstart CAD thinking in a reader. Also, there will be scratch building chassis and using Monte-Carlo simulation to estimate a robot's position in a known space.

Anyway, thanks for getting back to me - always excited to see what people have been building.

Danny