control icon indicating copy to clipboard operation
control copied to clipboard

Not able to scale the trajectory

Open deepakraina99 opened this issue 3 years ago • 1 comments

I am running the code using the following command:

python run.py arm3 dmp write --sequence 333 --scale 123

But this is not scaling the trajectory. I am attaching the plot here for your reference.

Screenshot from 2021-03-19 10-33-35

deepakraina99 avatar Mar 19 '21 05:03 deepakraina99

Hi! So it looks like this feature is not really easy to use for writing, and the scaling is, I believe actually intended as a scaling term for the force field. There are a couple of ways you can do scale the writing, though. The first is just in the write.py file you can change the writebox parameter to make the set of drawn numbers / letters the size that you want. This changes the target trajectory. With DMPs, however, the idea is that you just change the goal position and they do the scaling for you automatically. So the second is you can go into the dmp.py controller and after line 94 add in code specifying what you want the goal to be. For drawing the number 3 this goal works well:

        self.dmps.goal[0] = -0.5
        self.dmps.goal[1] = 1

But basically, I would recommend switching over to the ABR Control repository, which was based on this repo, but is much cleaner and actively maintained. It doesn't have some of the features of the studywolf control repo, but overall it's much easier to use. And then when you're in that repo there is this example which uses DMPs, and can be used as a template for implementing the same functionality here.

studywolf avatar Mar 19 '21 13:03 studywolf