PoMoCo python help

This is the place for queries that don't fit in any of the other categories.

PoMoCo python help

Postby TooManySecrets » Tue Jan 14, 2014 3:24 pm

Ok so im using a pythn program to control a robot and the program was made by a other guy.
The gui has several buttons to open new functionality and the program starts on the main screen.

Id like the program to click one of those buttons when it opens by itself since i need the program to run headless.

I have no idea how to program in python and if someone could help me do this id give them credit on the site the software was developed.

In the attachment is the full python code to run the program.

txh guys
Attachments
POMOCO.rar
(30.51 KiB) Downloaded 28 times
Last edited by stranac on Tue Jan 14, 2014 3:29 pm, edited 1 time in total.
Reason: First post lock.
TooManySecrets
 
Posts: 4
Joined: Tue Jan 14, 2014 3:19 pm

Re: PoMoCo python help

Postby metulburr » Tue Jan 14, 2014 3:38 pm

Id like the program to click one of those buttons when it opens by itself since i need the program to run headless.

You do not define which button you want pressed, or rather what action to take?
Code: Select all
        self.killButton = Button(self.frame, text="Kill All Servos",fg="red",
                                font=("Helvetica", 20),command=self.estop)
        self.killButton.grid(row=0, column=15, rowspan = 3, columnspan = 2)

        self.addSpace([18,0])
        
        
# create offset controls
        self.dB_Calibrate = Button(self.frame, text="Calibrate offsets", font=("Tahoma", 12), width = 15, command=self.ServoCalibration)
        self.dB_Calibrate.grid(row = 0, column = 20, rowspan = 2, sticky = N)
        self.OffsetControls = groupOffsetControl(self.frame, self.con, self.Dict, colX = 25, rowY = 0)

        # create manual controls
        self.dB_ManualContol = Button(self.frame, text="Manual control",    font=("Tahoma", 12), width = 15, command=self.ManualControl)
        self.dB_ManualContol.grid(row = 2, column = 20, rowspan = 2, sticky = N)
        self.ManualControls = groupManualControl(self.frame, self.con, self.Dict, colX = 25, rowY = 0)

        # create kinematic control 
        self.dB_KinematicContol = Button(self.frame, text="Kinematic control", font=("Tahoma", 12), width = 15, command=self.KinematicControl)
        self.dB_KinematicContol.grid(row = 4, column = 20, rowspan = 2, sticky = N)
        self.KinematicControls = groupKinematicControl(self.frame, self.con, self.Dict, colX = 25, rowY = 0)

        # create drawings control 
        self.dB_DrawingControl = Button(self.frame, text="Drawing", font=("Tahoma", 12), width = 15, command=self.DrawingControl)
        self.dB_DrawingControl.grid(row = 6, column = 20, rowspan = 2, sticky = N)
        self.DrawingControls = groupDrawingControl(self.frame, self.con, self.Dict, colX = 25, rowY = 0)
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1471
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: PoMoCo python help

Postby TooManySecrets » Tue Jan 14, 2014 4:47 pm

I just want the program to select kinematic control button on start or even start in kinematic control
TooManySecrets
 
Posts: 4
Joined: Tue Jan 14, 2014 3:19 pm

Re: PoMoCo python help

Postby metulburr » Tue Jan 14, 2014 5:46 pm

I highly doubt someone is going to just spend their time on modifying this without payment. If you would like i can move your post to the jobs section and you can post the amount you are willing to pay.

I took a brief look. He switches from tkinter to pygame and in tkinter he packed and gridded the same label which causes an error on your code (i dont know how you are even running it as is with that)
Code: Select all
    def addSpace(self, coords, rowspan = 1, columnspan = 1):
        l2 = Label(self.frame, text="\t\t", fg="red")
        l2.pack()
        l2.grid(row=coords[1], column=coords[0],rowspan=rowspan, columnspan=columnspan)
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1471
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: PoMoCo python help

Postby TooManySecrets » Thu Jan 16, 2014 12:27 pm

I was thinking it was a small addition to the code and i don't have money to pay for programming. This is just a hobby project.

the program seams to work for me. I don't understand anything you just said.
You where unable to run it?
TooManySecrets
 
Posts: 4
Joined: Tue Jan 14, 2014 3:19 pm

Re: PoMoCo python help

Postby metulburr » Thu Jan 16, 2014 12:54 pm

You where unable to run it?

I was , only after commenting out the pack method.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1471
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: PoMoCo python help

Postby stranac » Thu Jan 16, 2014 2:02 pm

TooManySecrets wrote:I just want the program to select kinematic control button on start or even start in kinematic control

That's easy to do - just a simple modification of the startGUI() function in GUI.py
Just add this line above the root.mainloop() one:
Code: Select all
app.KinematicControl()

This calls the same function that is called when you press the button.

What exactly do you mean by this?
TooManySecrets wrote:i need the program to run headless.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: PoMoCo python help

Postby TooManySecrets » Thu Jan 16, 2014 3:04 pm

That meens that i need it tu run in linux command line without gui. So it can autostart on my raspberry pi powerup.

edit:
tried to add your code and its starts to run and then i get this in a window.

Runtime error!!

Program C:\Python27\pythonw.exe
TooManySecrets
 
Posts: 4
Joined: Tue Jan 14, 2014 3:19 pm


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 6 guests

cron