Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How acceleration/deceleration values are calculated? #1

Open
ProVival opened this issue Apr 5, 2024 · 0 comments
Open

How acceleration/deceleration values are calculated? #1

ProVival opened this issue Apr 5, 2024 · 0 comments

Comments

@ProVival
Copy link

ProVival commented Apr 5, 2024

Hi, thanks for your work! I was on the process of learning SIPP-IP and was wondering how the values here are calculated and what do they mean exactly?
vector<pair<int, int>> costs = {make_pair(0, 20), make_pair(0, 29), make_pair(20, 15), make_pair(28, 12), make_pair(34, 6)};

Edit: Now i did understand after calculating the values right :D sorry for bothering about that. But i do have couple more questions

In the code below from applyPrimitive() function, in which cases there are more than one end-cell and when is it helpful?

if (new_tlower <= new_tupper && (mv.isEndCell && !endCellTouched) &&
                    mp.v == 0)
                { // if there is at least one timestep to get there and vel there is zero and this is the first end-cell in the primitive.
                    new_tupper = itr->first - 1 - mv.swt;
                }

Also here in comparison operator, any particular reason to compare based on this? Is the number 4 equal to MXO?
((a.x * MXW + a.y) * 4 + a.o) * MXV + a.v < ((b.x * MXW + b.y) * 4 + b.o) * MXV + b.v

Finally most important part for me. For example i want to have a=1m/s^2 and v_max = 1m/s, i also added a motion primitive so that it goes for just 1 cell and then stops like the following:

tmp.mvs = {Primitive::move(0, 0, 0, 20, 0), Primitive::move(dx[o], dy[o], 0, 20, 1)};
tmp.o = o;
tmp.v = 0;
motion_primitives[o][0].emplace_back(tmp);

But i can't figure out how should i modify motion primitves for acceleration and deceleration. Any chance you can give me an example for that? With my acceleration and v_max, it will have the max speed after moving 0.5m at t=1 and then it have to move the remaining 0.5m in 0.5s. So it will take 1.5seconds = 15 timestep to sweep first cell (cell we currently in). And to sweep through second cell, it has to go 10 timestep. So i tried to add the following to my motion primitives:

// acceleration primitives
tmp.v = 1; // at the end of primitive, v=1
tmp.mvs = {Primitive::move(0, 0, 0, 15, 0), Primitive::move(dx[o], dy[o], 0, 25 1)};
motion_primitives[o][0].push_back(tmp);
tmp.mvs.clear();

But with setting second moves sweeping time as 25 i feel like the solution states didn't make sense, so i changed it to 15 but i still don't know if it's correct or not.
I am really confused on how should i approach this, i would be really grateful if you could help me. Again, thanks for your amazing work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant