ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Hdifsttar's profile - activity

2019-05-20 01:17:41 -0500 marked best answer P2OS for ROS Kinetic on Debian Stretch

Hello,

I'm working on a Pioneer-3dx and was hoping to use the sonar data (as we only have sonar on it yet) to make it follow a moving object. I know I could juste use RosAria to get informations from the sonar but I also need to simulate it on Gazebo, thus I was advised p2os.

The problem is that I can't find a way to get p2os on Kinetic ROS for Debian Stretch. If someone could help me or provide me a link, I would warmly thank him.

Hdifsttar

2018-04-21 14:05:50 -0500 received badge  Famous Question (source)
2018-01-30 16:35:59 -0500 received badge  Famous Question (source)
2017-12-27 22:46:59 -0500 received badge  Famous Question (source)
2017-10-25 23:07:40 -0500 received badge  Famous Question (source)
2017-09-07 11:26:06 -0500 received badge  Notable Question (source)
2017-08-28 09:52:02 -0500 received badge  Notable Question (source)
2017-08-03 14:07:10 -0500 received badge  Popular Question (source)
2017-07-26 06:49:51 -0500 received badge  Famous Question (source)
2017-06-26 10:23:34 -0500 commented answer Fix the subscriber rate

Thank you very much for having found this, now it all makes sense ! I'll try to change it in the .cpp file directly to s

2017-06-26 10:18:13 -0500 commented answer Fix the subscriber rate

Thank you very much for having found this, now it all makes sense ! I'll try to change it in the .cpp file directly to s

2017-06-26 10:13:56 -0500 marked best answer Fix the subscriber rate

Hi everyone,

I wrote this code in order to retrieve a sonar range message, calculate a velocity based on it, and send it to my robot. I'm publishing at a 100Hz rate but subscribing at only 10Hz.(I've verified with rostopic hz). I'd like to have the same rate for both publishing and subscribing in order to have a different velocity transmitted at each loop.(And not 10 loops in a row transmitting the same information like in my example...)

How can I do that ? Is there something wrong with my code ? If anyone could help me, I'd be very grateful !

Hdifsttar

N.B. : I've read about tcpnodelay, but couldn't really understand what that does and if it fits the situation.

#########Publisher

pub_r1 = rospy.Publisher('/r1/cmd_vel', Twist)
pub_r2 = rospy.Publisher('/r2/cmd_vel', Twist)
rospy.init_node('p3dx_mover')
twist_r1 = Twist()
twist_r2 = Twist()

########Variables
i=0
rate = rospy.Rate(rospy.get_param('~hz', 100))

s_min = 0.3                         #minimum space between slave & master
s_max = 2                           #maximum space between slave & master
v_max = 0.4                         #maximum velocity of slave
alpha = v_max / (s_max - s_min)     #slope of the velocity function
b = alpha*s_max - v_max             #intercept of the velocity function

#########Subscriber

def callback(msg):
    rospy.loginfo("Sonar 4 detects something at %s m" % round(msg.range,3))
    if msg.range < 0.22:
        rospy.loginfo("Obstacle too close ! Not normal, vehicule stopped (You might want to revise the code)")
        twistr_r1.linear.x = 0
        pub_r1.publish(twist)
        rospy.signal_shutdown("Simulation end")

    beta = alpha*msg.range - b
    gamma = min(beta,v_max)
    twist_r1.linear.x = max(0, gamma)

sub = rospy.Subscriber("/r1/sonar4/scan", Range, callback)

#########Loop

while not rospy.is_shutdown() :

    twist_r2.linear.x = (math.cos(i) +2)/8
    i+=0.1
    rospy.loginfo("r1 velocity is "+ str(round(twist_r1.linear.x,3))+ " m/s" )
    rospy.loginfo("r2 velocity is "+ str(round(twist_r2.linear.x,3))+ " m/s" )
    pub_r1.publish(twist_r1)
    pub_r2.publish(twist_r2)
    rate.sleep()
2017-06-26 10:13:54 -0500 commented answer Fix the subscriber rate

Thank you very much for having found this, now it all makes sense !

2017-06-24 13:24:33 -0500 received badge  Notable Question (source)
2017-06-24 05:25:27 -0500 commented answer Fix the subscriber rate

I used hector_model sonar sensor. By checking the frequency you mean "rostopic hz /r1/sonar4/scan" ? Because this comman

2017-06-23 10:16:23 -0500 commented answer Fix the subscriber rate

That does make sense. Does it mean the sensor publish at its maximum rate by default ? Because I never set it to publish

2017-06-23 10:15:44 -0500 commented answer Fix the subscriber rate

That does make sense. Does it mean the sensor publish at its maximum rate by default ? Because I never set it to publish

2017-06-23 10:07:56 -0500 received badge  Popular Question (source)
2017-06-23 10:00:46 -0500 commented answer Fix the subscriber rate

That does make sense. Does it mean the sensor publish at its maximum rate by default ? Because I never set it to publish

2017-06-23 10:00:37 -0500 commented answer Fix the subscriber rate

That does make sense. Does it mean the sensor publish at their maximum rate by default ? Because I never set it to publi

2017-06-23 09:53:55 -0500 commented answer Fix the subscriber rate

That does make sense. Does it mean the sensors publish at their maximum rate by default ? Because I never set them to pu

2017-06-23 09:32:11 -0500 asked a question Fix the subscriber rate

Fix the subscriber rate Hi everyone, I wrote this code in order to retrieve a sonar range message, calculate a velocity

2017-06-07 09:45:07 -0500 received badge  Notable Question (source)
2017-06-07 03:06:00 -0500 answered a question Python ros multiple publisher

Thanks @Humpelstilzchen and @ufr3c_tjc. It worked just fine. If anyone's interested here's the code : #!/usr/bin/env py

2017-06-06 23:56:08 -0500 received badge  Popular Question (source)
2017-06-06 08:55:46 -0500 edited question Python ros multiple publisher

Python ros multiple publisher Hello, I'm working on two pioneer 3dx, and i'm trying to make one follow the other. To do

2017-06-06 08:54:40 -0500 asked a question Python ros multiple publisher

Python ros multiple publisher Hello, I'm working on two pioneer 3dx, and i'm trying to make one follow the other. To do

2017-06-06 05:15:16 -0500 received badge  Popular Question (source)
2017-06-06 03:53:04 -0500 received badge  Supporter (source)
2017-06-01 08:58:57 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 07:43:18 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 07:39:06 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 07:27:24 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 05:58:01 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 05:56:25 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robots on Gazebo. (D

2017-06-01 05:56:07 -0500 edited question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robot on Gazebo. (De

2017-06-01 05:56:07 -0500 received badge  Editor (source)
2017-06-01 05:54:21 -0500 asked a question Hector sonar implementation on a Pioneer 3DX

Hector sonar implementation on a Pioneer 3DX Hello, I'm working on a simulation of two Pioneer-3DX robot on Gazebo. (De

2017-06-01 02:59:10 -0500 received badge  Enthusiast
2017-05-24 03:40:54 -0500 edited question P2OS for ROS Kinetic on Debian Stretch

P2OS ROS Kinetic Debian Stretch Hello, I'm working on a Pioneer-3dx and was hoping to use the sonar data (as we only ha

2017-05-24 03:40:31 -0500 asked a question P2OS for ROS Kinetic on Debian Stretch

P2OS ROS Kinetic Debian Stretch Hello, I'm working on a Pioneer-3dx and was hoping to use the sonar data (as we only ha

2017-05-18 04:28:38 -0500 marked best answer How can I link Rosaria with Gazebo ? (Pioneer 3DX)

Hi, I've just recently begun to work on a pioneer P3DX. Before trying to get it moving, I wanted to try it on a simulator. I've run Aria with MobileSim fairly easily with the examples. So did I with RosAria and MobileSim following the tutorial and this : https://github.com/pengtang/rosaria_c...

But when it comes to Gazebo and RosAria, I'm lost. I made a P3DX move with https://github.com/SD-Robot-Vision/Pi... and https://github.com/SD-Robot-Vision/p3... , but it's with ROS. And since I ultimately want my robot moving in real life, I'm lost as how to get the RosAria example work on Gazebo. (Because i want the same code both working on Gazebo and on the P3DX)

And since I still don't understand all of this, even when reading this post about the exact same problem : http://answers.ros.org/question/25705... I'd wanted to know if someone could perhaps clarify it / help me on this.

I also found this, which pretty much is the same problem as mine : http://answers.ros.org/question/21581... but there was no answers as of today.

I've tried to be as clear as possible, sorry if I still sound confusing.

Hdifsttar

2017-05-18 04:28:38 -0500 received badge  Scholar (source)
2017-05-18 04:28:37 -0500 commented answer How can I link Rosaria with Gazebo ? (Pioneer 3DX)

Thanks Reed, I get it now.

2017-05-18 04:27:37 -0500 received badge  Notable Question (source)
2017-05-18 04:27:36 -0500 asked a question How can I link RosAria and Gazebo for the pioneer P3DX

How can I link RosAria and Gazebo for the pioneer P3DX Hi, I've just recently begun to work on a pioneer P3DX. Before tr

2017-05-16 09:42:02 -0500 received badge  Popular Question (source)
2017-05-12 18:39:17 -0500 asked a question How can I link Rosaria with Gazebo ? (Pioneer 3DX)

How can I link Rosaria with Gazebo ? (Pioneer 3DX) Hi, I've just recently begun to work on a pioneer P3DX. Before trying