Re: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects)
What are the parameters to account for in this type of algorithm? are there some checks to perform the arm moves ? for example angle moves or cartesian moves based on some distance thresholds? Any idea about the pseudo-algorithm is welcome. Thanks. Le dim. 23 juin 2024 à 10:33, Alan Gauld via Tutor a écrit : > On 22/06/2024 13:41, marc nicole wrote: > > > So, given the x,y,z coordinates of a target object and the offset x,y,z > of > > arms of a robot, what is a good algorithm to perform to grab the object > > between the hands (either from both sides or from below all using both > > hands). > > > > Specifically, my problem is applied to a NAO robot environment where I > > retrieve a target object coordinates using the following code: > > This is almost entirely outside the Python domain and all within > your 3rd party environment. Do they have a user forum or mailing > list? You will probably get better results asking there? > > Another possibility is that you are using a Python wrapper around > a C (or other language) library and there might be FAQs, fora or > lists supporting that. If so you should be able to translate > their examples to your Python code? > > In terms of generic solutions the only thing I can suggest that > might help is to research collision detection algorithms. > Wikipedia is likely a good starting point. > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > > ___ > Tutor maillist - tu...@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- https://mail.python.org/mailman/listinfo/python-list
Tkinter and astral characters (was: Decoding bytes to text strings in Python 2)
On 2024-06-24 01:14:22 +0100, MRAB via Python-list wrote: > Tkinter in recent versions of Python can handle astral characters, at least > back to Python 3.8, the oldest I have on my Windows PC. I just tried modifying https://docs.python.org/3/library/tkinter.html#a-hello-world-program to display "Hello World \N{ROCKET}" instead (Python 3.10.12 as included with Ubuntu 22.04). I don't get a warning or error, but the emoji isn't displayed either. I suspect that the default font doesn't include emojis and Tk isn't smart enough to fall back to a different font (unlike xfce4-terminal which shows the emoji just fine). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: Anonymous email users
> On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list > wrote: > > The spammers won the spam wars, so even if you have someone's real > e-mail address, that's no guarantee that you can contact them. You > certainly wouldn't be able to contact me at my real e-mail address, > unless you also had my phone number, so you could call me and tell > me that you sent me an e-mail, and what the subject line was so I > can find it. I don't even open my e-mail inbox unless there's a > specific message I'm expecting to find there right now. My email address is well known and yes I get spam emails. I use the wonderful python based spambayes software to detect spam and file into a Junk folder. It works for 99.9% of the emails I get. I am subscribed to a lot of mailing lists. I just checked and I am getting ~3,200 emails a month of which less than 200 are spam. A few years ago the spam count was greater than a 1,000 a month. I have been using spambayes for a very long time, 20 years I guess at this point and bayesian categorisation has stood the test of time for me. For me the spammers have not won, I have the tech to keep ahead of them. Barry -- https://mail.python.org/mailman/listinfo/python-list
Re: Anonymous email users
On 6/24/2024 5:51 AM, Barry Scott via Python-list wrote: On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list wrote: The spammers won the spam wars, so even if you have someone's real e-mail address, that's no guarantee that you can contact them. You certainly wouldn't be able to contact me at my real e-mail address, unless you also had my phone number, so you could call me and tell me that you sent me an e-mail, and what the subject line was so I can find it. I don't even open my e-mail inbox unless there's a specific message I'm expecting to find there right now. My email address is well known and yes I get spam emails. I use the wonderful python based spambayes software to detect spam and file into a Junk folder. It works for 99.9% of the emails I get. I use the Thunderbird mail client and I just use its built in spam detector. I don't know how it works but it's pretty darn good. Very few false positives or false negatives. And it learns each time I classify a message as "Junk", in case it missed one. I am subscribed to a lot of mailing lists. I just checked and I am getting ~3,200 emails a month of which less than 200 are spam. A few years ago the spam count was greater than a 1,000 a month. I have been using spambayes for a very long time, 20 years I guess at this point and bayesian categorisation has stood the test of time for me. For me the spammers have not won, I have the tech to keep ahead of them. Barry -- https://mail.python.org/mailman/listinfo/python-list
RE: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects)
Marc, Several people have supplied feedback on whether your request is a good fit for here. Ultimately it is up to the owner/moderator. In particular, your request to the Tutor List may not fit the purpose and be a bit complex and to the main Python List also outside some common usage whether it is about a specific module or product you are using, or asking about algorithms in a very general way. You question has evolved to being about algorithms, more than about Python as a basic language or even commonly used modules. So, I suggest you simplify your model and then maybe bring it in-line with the module(s) you showed us you were using. Some of what you ask sounds like it would be extremely commonly done in things like robotics, or even just machines with moving parts. Consider the somewhat related concept often seen of how you get from one place to another in parts of Manhattan where most of the streets run either in one direction or the orthogonal direction. How do you get from say East 14th Street at 1st Avenue to West 28th Street and 11th Avenue? This is a slight imitation of how to move a robotic arm that can mainly either go one way or another but not both at once. And, in the real world, parts of Manhattan are more complex with streets ending or renaming or running more diagonally or huge voids like Central Park. The number of solutions is huge for walking, and smaller for driving as some streets are one way. But assuming you avoid wasteful paths (except when roads are closed for endless purposes) and you do not take a path through Brooklyn, Queens and The Bronx and back to Manhattan as in the NY Marathon that also touches another borough, the solutions mainly look like this: Go as far horizontally as you need and then as far vertically. Or, do vertical, then horizontal. Or lots of combined versions such as climbing stairs by doing a block or three one way then some in the other and repeat. The above is referred to as Manhattan Distance, as compared to other measures like Euclidean distance. So back to your robot arm, you can see a set of simple solutions where you make a sort of triangle with the direct Euclidean arm being a hypoteneuse and the X and Y movements are the other two sides. You can then break up your problem as heading one way and pausing and turning the other way and stopping just short of the object you want. If there are no obstacles, you can do that in either order. Or, you could alternate in smaller amounts and get to the same destination. Grabbing it would be something else I will not address except to say that depending on what is grabbing and how it is shaped, you may need to aim not for the object, but the appropriate distance and direction so that when you stop moving, the "grasper" can close on it, again, avoiding existing obstacles. And note, speed is a consideration as many things need to be approached slowly and gently. Next, consider what it would mean if you could have a combined motion based on both operations allowed at the same time. Consider a robot that is on wheels that can move horizontally while also having a "lift" component that lifts the part with the graspers vertically. Both could be programmed to run in tandem at appropriate speeds so the graspers are traveling along the hypotenuse I mention and are going the shortest path. This might be faster and more economical in other ways but can be more complex. And, it may be the robot does not have power or computing ability to do both at the same time. Your design is beyond vague. Both of the approaches above make a plan and carry it out. But in the real world, many algorithms must adjust and work somewhat probabilistically. One algorithm for say catching a moving object, especially one that can change speed and direction a bit, like a running dog or a kite flying in the wind, is to locate where the object seems to be now, perhaps just a direction and a guess at distance, and maybe with some observation make a guess at where it might be at some time in the future that is approximately when you might move the robot near there. Then, use a technique like above (or completely different) that perhaps aims to get you something like halfway there. Monitor along the way to update your position and the newest destination position (if it is moving) and re-evaluate and adjust for the next round and maybe evaluate again as you approach halfway or so, again. Eventually, if you are close, slow down and gradually try to come to a stop where you can grab. If the object reacts to your attempting to go after it, it can be complex. And, you may overshoot and sort of circle back. Now, expand the problem more if needed. What does the robot look like. How many places can it bend? For example, can it have something like two or more elbows, perhaps one allowing twisting of up to 30 degrees and one moving forward and backward and another allowing movement side to s
Re: Anonymous email users
On 25/06/24 05:17, Thomas Passin via Python-list wrote: On 6/24/2024 5:51 AM, Barry Scott via Python-list wrote: On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list wrote: The spammers won the spam wars, so even if you have someone's real e-mail address, that's no guarantee that you can contact them. You certainly wouldn't be able to contact me at my real e-mail address, unless you also had my phone number, so you could call me and tell me that you sent me an e-mail, and what the subject line was so I can find it. I don't even open my e-mail inbox unless there's a specific message I'm expecting to find there right now. My email address is well known and yes I get spam emails. I use the wonderful python based spambayes software to detect spam and file into a Junk folder. It works for 99.9% of the emails I get. I use the Thunderbird mail client and I just use its built in spam detector. I don't know how it works but it's pretty darn good. Very few false positives or false negatives. And it learns each time I classify a message as "Junk", in case it missed one. I am subscribed to a lot of mailing lists. I just checked and I am getting ~3,200 emails a month of which less than 200 are spam. A few years ago the spam count was greater than a 1,000 a month. I have been using spambayes for a very long time, 20 years I guess at this point and bayesian categorisation has stood the test of time for me. For me the spammers have not won, I have the tech to keep ahead of them. Aside from the attractions of the new, and the 'shiny', what email-antagonists didn't anticipate, was that as fast as they moved to non-email messaging, the spammers, advertisers, and malcontents would simply do the same. Thus, a variation on whack-a-mole, as folk move from platform to platform trying to stay-ahead and find an illusion of safety. Quite how one out-runs human-nature is an issue philosophised-over by the (Ancient) Greeks (and was no-doubt old even-then). Paradoxically, applying for an account elsewhere usually involves providing an email address. Even backing-up a cell-phone (communication tool) to the cloud requires an email address(!!!) Most of the non-email platforms are provided by organisations who have 'other uses' for your personal-data (and not forgetting GMail and MSFT's email services). Python mailing-lists are covered by the Code of Conduct and monitored by ListAdmins. Thus, there are controls which limit the impact which advertisers and others with non-pythonic aims might otherwise exert! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list
Re: Anonymous email users
On Tue, 25 Jun 2024 at 08:31, dn via Python-list wrote: > Python mailing-lists are covered by the Code of Conduct and monitored by > ListAdmins. Thus, there are controls which limit the impact which > advertisers and others with non-pythonic aims might otherwise exert! > So long as there's a newsgroup gateway, those controls are toothless. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Anonymous email users
On 2024-06-24, Barry Scott via Python-list wrote: >> On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list >> wrote: >> >> The spammers won the spam wars, so even if you have someone's real >> e-mail address, that's no guarantee that you can contact them. [...] > > My email address is well known and yes I get spam emails. I've been puzzled by this for a long time. Many people talk about how they get so much spam e-mail that there's little chance they'll notice if I send them an e-mail. I've been using the same e-mail address for about 20 years. I've use that e-mail address with probably close to 100 retailers, charities, open-source projects, media sites, and various other organizations. I get at most a few spam emails per week [I just checked my spam folder: 8 in the past 30 days]. And Gmail is very, very close to 100% accurate at filtering them out. I can't remember the last time I actually got a spam message in my inbox. > A few years ago the spam count was greater than a 1,000 a month. I'm baffled. Is Gmail silently rejecting that much junk before it even gets to the filter that puts stuff into my "spam" folder? -- Grant -- https://mail.python.org/mailman/listinfo/python-list
Re: Anonymous email users
On Tue, 25 Jun 2024 at 11:41, Grant Edwards via Python-list wrote: > I've been using the same e-mail address for about 20 years. I've use > that e-mail address with probably close to 100 retailers, charities, > open-source projects, media sites, and various other organizations. Mostly the same, although in my case, I've had multiple email addresses for different purposes (and still kept all of them for decades). > I get at most a few spam emails per week [I just checked my spam > folder: 8 in the past 30 days]. And Gmail is very, very close to 100% > accurate at filtering them out. I can't remember the last time I > actually got a spam message in my inbox. > > > A few years ago the spam count was greater than a 1,000 a month. > > I'm baffled. Is Gmail silently rejecting that much junk before it > even gets to the filter that puts stuff into my "spam" folder? > It really depends on how you count. On my mail server (can't get stats for Gmail), I have a number of anti-spam and anti-abuse rules that apply prior to the Bayesian filtering (for example, protocol violations), and any spam that gets blocked by those rules isn't shown in my stats. And then I have a further set of rules that nuke some of the most blatant spam, and finally the regular trainable filter. I should probably keep better stats on the stuff I don't keep, but at the moment, all I actually track is the ones that the filter sees - which is roughly 25-50 a day. So yeah, Gmail is probably rejecting that much junk, but most of it for protocol violations. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
RE: Anonymous email users
This discussion has wandered far from my original mention that I found it hard to reply to people using an invalid email address. I see no real connection to python except insofar as at least one spam-filter mentioned is written in python! Just to add an observation, the people writing here have obviously had many different experiences with their email addresses and whether yours is hijacked in some way, and made less useful, can even just become down to random luck. But SPAM filters can also be manipulated and cause you to lose mail. I think some people have been reporting email from a source they do not favor, such as for political reasons, that then ends up being junked for people who would welcome the messages. And, I can well imagine how something like a post about python programs can start being filtered out because some key words commonly use end up being used a lot in some kind of SPAM and the filter "learns" to filter those out. Imagine of "python" appeared in lots of actual SPAM messages as the war moved on, such as in the metadata designed to make it look legit. Email addresses can go bad for many reasons. My wife had a nice simple address like jane.sm...@gmail.com that was messed up probably by well-meaning people when another Jane Smith had an email address like smith.jane or janesmith123 and they or others typed in the more straightforward ones. It seems we ended up getting odd email from many continents such as e-tickets for airplanes, initial estimates or bills from vendors for products in places we have never been for services rendered in say Tennessee or South Africa (well, I've been in Tennessee, but) and subscriptions to internet magazines or groups that sent lots of messages, or conversations between lots of people (all To: or Cc:) that included her email address wrongly and even when she replied to ask to be taken off, the conversations continued for months as many kept hitting reply-all, ...) And, obviously, with so many people using the address wrongly, SPAM followed. Of course, choosing a strange name designed not to be typed by accident, has it's own disadvantages. But for those who want me to CALL their unspecified phone number and tell them the subject line and then maybe you will look for my message, FUGGEDABOUTIT! I have a cousin who does a trick with her phone service where she never answers and I have to run some gauntlet to identify myself and then wait for a call back. After a few times, I solved the problem and simply never call her. Admittedly, making it hard for an email address to be abused in a forum like this is understandable. Making it very hard to reach you legitimately when the message is that your house is burning or just that your appointment is canceled, may not work as well as you think. And, FYI, I check my junkmail regularly and I have a fairly high rate of finding things, including posts on forums like this one, that are NOT in my opinion junk as I ordered them and they are on topic and not easily visible as having committed some kind of sin. And as I use many email services, I still find a high rate of false negatives everywhere. It would not surprise me if a phrase like "not SPAM" gets this message dumped into /dev/null -Original Message- From: Python-list On Behalf Of Chris Angelico via Python-list Sent: Monday, June 24, 2024 9:49 PM To: python-list@python.org Subject: Re: Anonymous email users On Tue, 25 Jun 2024 at 11:41, Grant Edwards via Python-list wrote: > I've been using the same e-mail address for about 20 years. I've use > that e-mail address with probably close to 100 retailers, charities, > open-source projects, media sites, and various other organizations. Mostly the same, although in my case, I've had multiple email addresses for different purposes (and still kept all of them for decades). > I get at most a few spam emails per week [I just checked my spam > folder: 8 in the past 30 days]. And Gmail is very, very close to 100% > accurate at filtering them out. I can't remember the last time I > actually got a spam message in my inbox. > > > A few years ago the spam count was greater than a 1,000 a month. > > I'm baffled. Is Gmail silently rejecting that much junk before it > even gets to the filter that puts stuff into my "spam" folder? > It really depends on how you count. On my mail server (can't get stats for Gmail), I have a number of anti-spam and anti-abuse rules that apply prior to the Bayesian filtering (for example, protocol violations), and any spam that gets blocked by those rules isn't shown in my stats. And then I have a further set of rules that nuke some of the most blatant spam, and finally the regular trainable filter. I should probably keep better stats on the stuff I don't keep, but at the moment, all I actually track is the ones that the filter sees - which is roughly 25-50 a day. So yeah, Gmail is probably rejecting that much junk, but most of it for protocol violations. ChrisA -- http