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

Couldn't find /clock topic

asked 2019-08-30 04:58:51 -0600

rayane gravatar image

updated 2019-08-30 05:34:46 -0600

pavel92 gravatar image

Hi,

I want to get the simulation time published on the clock topic because the current time in ROS is set by default in the system time of the machine!!

The problem is that I can't find any topic named /clock or a parameter named use_sim_time here is what I get:

rostopic list:

/bebop/autoflight/navigate_home
/bebop/autoflight/pause
/bebop/autoflight/start
/bebop/autoflight/stop
/bebop/bebop_nodelet/parameter_descriptions
/bebop/bebop_nodelet/parameter_updates
/bebop/bebop_nodelet_manager/bond
/bebop/camera_control
/bebop/camera_info
/bebop/cmd_vel
/bebop/fix
/bebop/flattrim
/bebop/flip
/bebop/image_raw
/bebop/image_raw/compressed
/bebop/image_raw/compressed/parameter_descriptions
/bebop/image_raw/compressed/parameter_updates
/bebop/image_raw/compressedDepth
/bebop/image_raw/compressedDepth/parameter_descriptions
/bebop/image_raw/compressedDepth/parameter_updates
/bebop/image_raw/theora
/bebop/image_raw/theora/parameter_descriptions
/bebop/image_raw/theora/parameter_updates
/bebop/joint_states
/bebop/land
/bebop/odom
/bebop/record
/bebop/reset
/bebop/set_exposure
/bebop/snapshot
/bebop/states/ardrone3/CameraState/Orientation
/bebop/states/ardrone3/GPSState/NumberOfSatelliteChanged
/bebop/states/ardrone3/MediaStreamingState/VideoEnableChanged
/bebop/states/ardrone3/PilotingState/AltitudeChanged
/bebop/states/ardrone3/PilotingState/AttitudeChanged
/bebop/states/ardrone3/PilotingState/FlatTrimChanged
/bebop/states/ardrone3/PilotingState/FlyingStateChanged
/bebop/states/ardrone3/PilotingState/NavigateHomeStateChanged
/bebop/states/ardrone3/PilotingState/PositionChanged
/bebop/states/ardrone3/PilotingState/SpeedChanged
/bebop/states/common/CommonState/BatteryStateChanged
/bebop/states/common/CommonState/WifiSignalChanged
/bebop/states/common/FlightPlanState/AvailabilityStateChanged
/bebop/states/common/FlightPlanState/ComponentStateListChanged
/bebop/states/common/MavlinkState/MavlinkFilePlayingStateChanged
/bebop/states/common/MavlinkState/MavlinkPlayErrorStateChanged
/bebop/states/common/OverHeatState/OverHeatChanged
/bebop/takeoff
/rosout
/rosout_agg
/tf
/tf_static

rosparam list:

/bebop/bebop_nodelet/GPSSettingsHomeTypeType
/bebop/bebop_nodelet/GPSSettingsReturnHomeDelayDelay
/bebop/bebop_nodelet/NetworkSettingsWifiSelectionBand
/bebop/bebop_nodelet/NetworkSettingsWifiSelectionChannel
/bebop/bebop_nodelet/NetworkSettingsWifiSelectionType
/bebop/bebop_nodelet/PictureSettingsVideoFramerateFramerate
/bebop/bebop_nodelet/PictureSettingsVideoRecordingModeMode
/bebop/bebop_nodelet/PictureSettingsVideoResolutionsType
/bebop/bebop_nodelet/PictureSettingsVideoStabilizationModeMode
/bebop/bebop_nodelet/PilotingSettingsAbsolutControlOn
/bebop/bebop_nodelet/PilotingSettingsBankedTurnValue
/bebop/bebop_nodelet/PilotingSettingsCirclingAltitudeValue
/bebop/bebop_nodelet/PilotingSettingsCirclingDirectionValue
/bebop/bebop_nodelet/PilotingSettingsCirclingRadiusValue
/bebop/bebop_nodelet/PilotingSettingsMaxAltitudeCurrent
/bebop/bebop_nodelet/PilotingSettingsMaxDistanceValue
/bebop/bebop_nodelet/PilotingSettingsMaxTiltCurrent
/bebop/bebop_nodelet/PilotingSettingsMinAltitudeCurrent
/bebop/bebop_nodelet/PilotingSettingsNoFlyOverMaxDistanceShouldnotflyover
/bebop/bebop_nodelet/PilotingSettingsPitchModeValue
/bebop/bebop_nodelet/SpeedSettingsHullProtectionPresent
/bebop/bebop_nodelet/SpeedSettingsMaxPitchRollRotationSpeedCurrent
/bebop/bebop_nodelet/SpeedSettingsMaxRotationSpeedCurrent
/bebop/bebop_nodelet/SpeedSettingsMaxVerticalSpeedCurrent
/bebop/bebop_nodelet/SpeedSettingsOutdoorOutdoor
/bebop/bebop_nodelet/bebop_ip
/bebop/bebop_nodelet/camera_info_url
/bebop/bebop_nodelet/cmd_vel_timeout
/bebop/bebop_nodelet/odom_frame_id
/bebop/bebop_nodelet/publish_odom_tf
/bebop/bebop_nodelet/reset_settings
/bebop/bebop_nodelet/states/enable_altitudechanged
/bebop/bebop_nodelet/states/enable_autotakeoffmodechanged
/bebop/bebop_nodelet/states/enable_camerastate_orientation
/bebop/bebop_nodelet/states/enable_commonstate_batterystatechanged
/bebop/bebop_nodelet/states/enable_commonstate_wifisignalchanged
/bebop/bebop_nodelet/states/enable_controllerstate_ispilotingchanged

My purpose is to generate a sinosoidal trajectory with cos( pi t) and the time t here has to be set to 0 when the simulation starts.

Any suggestion please !!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-30 05:32:40 -0600

pavel92 gravatar image

updated 2019-08-30 05:43:48 -0600

You can check the clock documentation and this question regarding the /clock topic and use_sim_time parameter. Basically you need something like a rosbag or simulation to publish on the /clock topic.

If you are using Gazebo check this question and documentation.
Regarding rosbags, check this question.

edit flag offensive delete link more

Comments

@pavel92 thanks for your answer

But my problem is that the parameter use_sim_time doesn't exist theck please the listed parameters shown in the question area and also the topics there is no such a topic named /clock .

rayane gravatar image rayane  ( 2019-08-30 06:06:54 -0600 )edit

The parameter exists, just is not set. Try setting it with:

rosparam set use_sim_time true

and then rosparam list will show it.

pavel92 gravatar image pavel92  ( 2019-08-30 06:17:12 -0600 )edit

@pavel92 thanks it shows now the parameter!! Maybe I didn't ask the question correctly!! How can I manage to get the data from two topics after 0.1 seconds!!! because the subscriber gets the message when it is available but we can't set it to get a message each 0.1 seconds!! I hope I made it clear enough. Thanks

rayane gravatar image rayane  ( 2019-08-30 08:53:26 -0600 )edit

This is completely different question from the one you initially asked. If the answer helped you solve your initial problem you can accept it as correct. Otherwise regarding your follow-up question you can check ros timers (Timers let you schedule a callback to happen at a specific rate through the same callback queue mechanism used by subscription, service, etc. callbacks. ).
If timers cant solve your problem then I suggest asking a new question.

pavel92 gravatar image pavel92  ( 2019-08-30 11:45:24 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-08-30 04:58:51 -0600

Seen: 1,474 times

Last updated: Aug 30 '19