Wheel rotation of mobile robot at 180 degree

Requests regarding how to set up experiments in ARGoS.
Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

Wheel rotation of mobile robot at 180 degree

Postby Waqar731 » Tue Mar 10, 2015 8:12 am

Hello to all
I am trying to rotate the robot at 180 degree on single step of simulation out of three buttons. But robot only move maximum of 30 degree at each time step. The code is given below:

Code: Select all

Real fLeftWheelSpeed, fRightWheelSpeed; fLeftWheelSpeed = m_sWheelTurningParams.MaxSpeed; fRightWheelSpeed = -m_sWheelTurningParams.MaxSpeed; m_pcWheels->SetLinearVelocity(fLeftWheelSpeed, fRightWheelSpeed);
How can i do this?
I want to achieve the goal, when i press the one step of simulation then my robot should move its wheels at 180 degree. While robot should not change its position but only wheels should move at desired angle.

Thanks
Waqar Hussain

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Wheel rotation of mobile robot at 180 degree

Postby pincy » Tue Mar 10, 2015 11:19 pm

Hi,
I am trying to rotate the robot at 180 degree on single step of simulation out of three buttons.
What do you mean by "out of three buttons" ?
But robot only move maximum of 30 degree at each time step. The code is given below:

Code: Select all

Real fLeftWheelSpeed, fRightWheelSpeed; fLeftWheelSpeed = m_sWheelTurningParams.MaxSpeed; fRightWheelSpeed = -m_sWheelTurningParams.MaxSpeed; m_pcWheels->SetLinearVelocity(fLeftWheelSpeed, fRightWheelSpeed);
This code does not contain the algorithm with which you choose the speeds. How do you calculate them?
I want to achieve the goal, when i press the one step of simulation then my robot should move its wheels at 180 degree. While robot should not change its position but only wheels should move at desired angle.
If I interpret what you say correctly, you want the robot to rotate on the spot by 180 degrees in one time step. While this is not realistic at all (a time step is typically 1/10 of a second, and no motor will ever give that much speed in such a short time!), a possible way to do this is by using the differential steering model: http://rossum.sourceforge.net/papers/DiffSteer/.

To rotate by an angle A in T seconds, you need to attain a rotational speed of A/T. Since you want to rotate on the spot, you need to set both wheel speeds to the same absolute value V; however, one wheel will be set a positive speed, and the other a negative one.

From the differential steering model, you obtain the following equation:

A / T = (V - (-V)) / B

where B is the distance of the two wheels. For the foot-bot, B = 14cm (see https://github.com/ilpincy/argos3/blob/ ... entity.cpp).

Reworking the above equation, we get:

V = (A * B) / (2 * T)

Plugging in the values you wanted, A = 3.14 rad and T = 0.1 sec, you get V = 219.8 cm/sec, that is, more than 2 m/s. For a real application this value is ludicrous, so I would suggest you to try a more realistic behavior.

Also, notice that the above reasoning does not consider the natural noise in wheel actuation. You can see the effect of wheel noise in ARGoS with this syntax:

Code: Select all

<controllers> ... <my_controller ...> ... <actuators> ... <differential_steering implementation="default" noise_std_dev="1" /> ... </actuators> ... </my_controller> ... </controllers>


where noise_std_dev is the standard deviation of the Gaussian noise applied to the ideal wheel speed you set with SetLinearSpeed().

Cheers,
Carlo
I made ARGoS.

Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

Re: Wheel rotation of mobile robot at 180 degree

Postby Waqar731 » Wed Mar 11, 2015 8:58 am

Hi
I just want to do because i want to make my mobile robot rotate easily at any angle to any grid out of 8 adjacent connected grids at one time step. If it is not possible in reality, then how it is going on in flocking example in argos2 simulator.

Why speed of one wheel is set to be +ive and other is -ive?

Moreover, differential_steering is not enabled in argos2 simulator. How can we resolve this issue?



Thanks
Waqar Hussain

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Wheel rotation of mobile robot at 180 degree

Postby pincy » Wed Mar 11, 2015 7:45 pm

I just want to do because i want to make my mobile robot rotate easily at any angle to any grid out of 8 adjacent connected grids at one time step. If it is not possible in reality, then how it is going on in flocking example in argos2 simulator.
I think you're misunderstanding. In the flocking example the robots follow a vector. They do not rotate by fixed angles.
Why speed of one wheel is set to be +ive and other is -ive?
Just play with the speeds in ARGoS and you'll see. If you want to turn on the spot, that's the only way.
Moreover, differential_steering is not enabled in argos2 simulator. How can we resolve this issue?
In ARGoS2 use footbot_wheels.

Cheers,
Carlo
I made ARGoS.

Waqar731
Posts: 65
Joined: Thu Oct 23, 2014 12:33 pm
Location: Pakistan
Contact:

Re: Wheel rotation of mobile robot at 180 degree

Postby Waqar731 » Wed Mar 11, 2015 9:12 pm

Hi,
i fulfill the requirements to rotate the robot at any desired angle between [0,360] as you suggested already.
  • (i) to use the wheels actuator.
    (ii) to make the same speed of both wheels.
    (iii) to use +ive and -ive speeds of both wheels.
But my robot is not rotating greater than 30 degree? Following is the specific code of .cpp file.

Code: Select all

Real fLeftWheelSpeed, fRightWheelSpeed; fLeftWheelSpeed = m_sWheelTurningParams.MaxSpeed; fRightWheelSpeed = -m_sWheelTurningParams.MaxSpeed; m_pcWheels->SetLinearVelocity(fLeftWheelSpeed, fRightWheelSpeed);
[/color]

Here, value of maxSpeed is set in XML with 30.

I also try to increase the speed, but i getting the same rotation as in case of 30 degree.

How can i improve this code which makes the robot able to rotate at 180 degree to its wheels on the same spot?
Waqar Hussain

Parshan
Posts: 1
Joined: Sat May 13, 2023 8:16 am

Re: Wheel rotation of mobile robot at 180 degree

Postby Parshan » Wed May 17, 2023 10:26 am

Why speed of one wheel is set to be +ive and other is -ive?FM WhatsApp
To rotate them in different directions at the same speed while keeping the robot at the current position. If you keep both of them at +ve or -ve, it will move the robot forward or backback respectively.


Return to “How to... ?”