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

jdastoor3's profile - activity

2022-03-27 09:09:22 -0500 received badge  Notable Question (source)
2022-02-04 09:19:02 -0500 received badge  Famous Question (source)
2022-02-04 09:19:02 -0500 received badge  Notable Question (source)
2022-02-04 09:19:02 -0500 received badge  Popular Question (source)
2022-01-25 10:23:03 -0500 received badge  Famous Question (source)
2022-01-10 17:41:12 -0500 received badge  Student (source)
2022-01-10 09:46:44 -0500 asked a question pygazebo publisher

pygazebo publisher Hi, I have been trying to write a publisher in pygazebo in order to change the fog level in my gazebo

2021-12-18 17:23:44 -0500 commented answer Add fog to gazebo using rospy

Hi, I have tried to add a publisher, however I get an error saying .publish is not a feature of asyncio.Future

2021-12-15 10:16:12 -0500 commented answer Add fog to gazebo using rospy

Thank you so much!

2021-12-13 16:24:03 -0500 commented answer Add fog to gazebo using rospy

Ya it does not seem to be connecting for me either. I tried using trollius instead, but that also did not work.

2021-12-13 16:24:03 -0500 received badge  Commentator
2021-12-13 15:07:51 -0500 commented answer Add fog to gazebo using rospy

I've got py3gazebo working now with the tweaks you made and am able to call the fog_pb2 file in the msg folder without a

2021-12-13 15:05:55 -0500 commented answer Add fog to gazebo using rospy

I've got py3gazebo working now with the tweaks you made and am able to call the fog_pb2 file without any errors. However

2021-12-13 14:19:29 -0500 commented answer Add fog to gazebo using rospy

Using pygazebo, did you have to use python 3.6?

2021-12-13 12:17:24 -0500 commented answer Add fog to gazebo using rospy

I want to be able to change the fog level inside my script during each main loop. So I can set the base fog level in the

2021-12-13 11:48:19 -0500 received badge  Notable Question (source)
2021-12-13 11:36:26 -0500 commented answer Add fog to gazebo using rospy

Thank you for the response! I tried using SetLightProperties, however the light only seems to have an impact on the land

2021-12-12 17:28:59 -0500 received badge  Popular Question (source)
2021-12-12 01:51:32 -0500 received badge  Popular Question (source)
2021-12-11 17:42:23 -0500 commented question Add fog to gazebo using rospy

Update: I managed to get a bit further, but now I get another error in pygazebo.py: line 251, future = asyncio.async(l

2021-12-11 17:42:20 -0500 commented question Add fog to gazebo using rospy

Update: I managed to get a bit further, but now I get another error in pygazebo.py: line 251, future = asyncio.async(l

2021-12-11 17:42:15 -0500 commented question Add fog to gazebo using rospy

Update: I managed to get a bit further, but now I get another error in pygazebo.py: line 251, future = asyncio.async(l

2021-12-11 17:42:10 -0500 commented question Add fog to gazebo using rospy

Update: I managed to get a bit further, but now I get another error in pygazebo.py: line 251, future = asyncio.async(l

2021-12-11 17:41:50 -0500 commented question Add fog to gazebo using rospy

Update: I managed to get a bit further, but now I get another error in pygazebo.py: line 251, future = asyncio.async(l

2021-12-11 17:27:14 -0500 commented question Add fog to gazebo using rospy

I followed the steps at the bottom of py3gazebo to convert the python2 version to the python3 version, yet that still gi

2021-12-11 16:48:38 -0500 commented question Add fog to gazebo using rospy

I tried doing that just now, and I get an error saying "cannot import name 'connect' from partially initialized module '

2021-12-11 16:48:07 -0500 commented question Add fog to gazebo using rospy

I tried doing that just now, and I get an error saying "cannot import name 'connect' from partially initialized module '

2021-12-11 15:08:22 -0500 asked a question Add fog to gazebo using rospy

Add fog to gazebo using rospy Hi, I have been trying to create a script that will spawn objects and take images of them

2021-12-11 14:24:39 -0500 marked best answer Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

Hi,

I have been working on a Python class that will allow me to spawn an object in gazebo, take an image of the object, and then delete that object, for a given number of objects that I provide. I am able to spawn the objects, and have written a subscriber that is able to take images using a sensor. However, the images that are saved are not being taken in the order I am asking them to. Starting the script, I seem to be getting images out of order. For example, if I set it to spawn 5 objects without deleting for clarity, and take an image each time a new object is spawned, I could have 1 image without any objects, 3 images with 2 objects present, and the last image with 3 objects present. Sometimes I even get images with objects in positions that were set the last time I ran the script.

I thought this was because my publisher and subscriber were working at different rates, so looking at the answers on this forum I added queue_size=1 and buff_size = 2***30, to make sure that it was taking the last image that was sent. However, the problem is still there and nothing has changed. I have also tried increasing the time delay which has not helped, and was trying to find a way to delete the subscriber queue each time so that the latest message was definitely the one being read, but I have been unable to do so. I am not sure how to solve this and was wondering if anyone had a solution to this or an idea of why this was happening? I have attached my code below. Thanks!

import numpy as np
import rospy, tf, time
from gazebo_msgs.srv import SpawnModel, DeleteModel, GetModelState
from geometry_msgs.msg import *
from take_photo import ImageNode
# ROS Image message
from sensor_msgs.msg import Image
# ROS Image message -> OpenCV2 image converter
from cv_bridge import CvBridge, CvBridgeError
# OpenCV2 for saving an image
import cv2
import os

class ImageCollection():
    def __init__(self, number_spawn, model_path, time_delay=3.0):
        print("Waiting for gazebo services...")
        #rospy.init_node("spawn_products_in_bins")
        rospy.wait_for_service("gazebo/delete_model")
        rospy.wait_for_service("gazebo/spawn_sdf_model")
        rospy.wait_for_service("gazebo/get_model_state")
        print("Got it.")
        self.delete_model = rospy.ServiceProxy("gazebo/delete_model", DeleteModel)
        self.spawn_model = rospy.ServiceProxy("gazebo/spawn_sdf_model", SpawnModel)
        self.model_coordinates = rospy.ServiceProxy("gazebo/get_model_state", GetModelState)

        # Instantiate CvBridge
        self.bridge = CvBridge()
        self.image_number = 0
        self.number_spawn = number_spawn
        self.time_delay = time_delay
        self.model_path = model_path

        # Create a directory to store images
        self.folder_path = "Gazebo_Images"
        try:
            os.mkdir(self.folder_path)
        except:
            print("Folder already exists, appending to that folder...")

        # Initialize the node
        rospy.init_node('image_listener')
        # Define your image topic
        self.image_topic = "/wamv/sensors/cameras/front_left_camera/image_raw"
        # Set up your subscriber and define its callback
        # rospy.Subscriber(image_topic, Image, self.image_callback)
        # rospy.spin()

    def spawn(self):

        with open(self.model_path, "r") as f:
            product_xml = f.read()

        # Determine a random position for the buoy (function has not been shown here but is just a random generator)
        bin_x, bin_y ...
(more)
2021-12-11 14:24:39 -0500 received badge  Scholar (source)
2021-12-11 14:15:48 -0500 commented answer Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

So essentially I should just save the msg that callback receives, and create a main function which has the code currentl

2021-12-11 14:14:30 -0500 commented answer Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

So essentially I should just save the msg that callback receives, and create a main function which has the code currentl

2021-12-11 12:58:50 -0500 received badge  Enthusiast
2021-12-10 17:53:36 -0500 commented question Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

I was unaware that was a possibility. Would that avoid the issues I have been having? I found this script, would that be

2021-12-10 16:39:51 -0500 edited question Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

Image Subscriber Lags (despite queue_size=1 and buff_size=2**30) Hi, I have been working on a Python class that will al

2021-12-10 16:39:51 -0500 received badge  Editor (source)
2021-12-10 16:39:38 -0500 edited question Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

Image Subscriber Lags (despite queue_size=1 and buff_size=2**30) Hi, I have been working on a Python class that will al

2021-12-10 16:39:18 -0500 asked a question Image Subscriber Lags (despite queue_size=1 and buff_size=2**30)

Image Subscriber Lags (despite queue_size=1 and buff_size=2**30) Hi, I have been working on a Python class that will al

2021-11-16 08:24:29 -0500 asked a question Rospy has no attribute ServiceProxy

Rospy has no attribute ServiceProxy I have been trying to create a script that will delete and spawn objects in gazebo.