Skip to content

Commit

Permalink
Fix Sdf version warning and LogRecord error(#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jialn authored Nov 27, 2019
1 parent c527050 commit 249929f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pygazebo/pygazebo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ void Initialize(const std::vector<std::string>& args,
{
gazebo::util::LogRecordParams params;
params.period = 1e300; // In fact, we don't need to do logging.
// gazebo::util::LogRecord::Instance()->Init("pygazebo");
gazebo::util::LogRecord::Instance()->Init("pygazebo");
gazebo::util::LogRecord::Instance()->Start(params);
gazebo::util::LogRecord::Instance()->Stop();
}
}
gazebo_initialized = true;
Expand Down
4 changes: 2 additions & 2 deletions python/social_bot/envs/gazebo_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def render(self, mode='human'):
if self._rendering_camera is None:
render_camera_sdf = """
<?xml version='1.0'?>
<sdf version ='1.4'>
<sdf version ='1.6'>
<model name ='render_camera'>
<static>1</static>
<pose>%s</pose>
Expand Down Expand Up @@ -148,7 +148,7 @@ def insert_model(self, model, name=None, pose="0 0 0 0 0 0"):
name = model
model_sdf = """
<?xml version='1.0'?>
<sdf version ='1.4'>
<sdf version ='1.6'>
<model name=""" + name + """>
<include>
<uri>model://""" + model + """</uri>
Expand Down
6 changes: 4 additions & 2 deletions python/social_bot/envs/play_ground.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self,
self._action_cost = action_cost
self._with_language = with_language
self._seq_length = vocab_sequence_length
self._with_agent_language = with_agent_language
self._with_agent_language = with_language and with_agent_language
self._use_image_obs = use_image_observation
self._image_with_internal_states = self._use_image_obs and image_with_internal_states

Expand Down Expand Up @@ -260,11 +260,13 @@ def main():
import matplotlib.pyplot as plt
import time
with_language = True
with_agent_language = False
use_image_obs = False
image_with_internal_states = True
fig = None
env = PlayGround(
with_language=with_language,
with_agent_language=with_agent_language,
use_image_observation=use_image_obs,
image_with_internal_states=image_with_internal_states,
agent_type='kuka_lwr_4plus',
Expand All @@ -274,7 +276,7 @@ def main():
last_done_time = time.time()
while True:
actions = env._control_space.sample()
if with_language:
if with_agent_language:
actions = dict(control=actions, sentence="hello")
obs, _, done, _ = env.step(actions)
step_cnt += 1
Expand Down
2 changes: 1 addition & 1 deletion python/social_bot/worlds/play_ground.world
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
Copyright (c) 2019 Horizon Robotics. All Rights Reserved. -->
<!-- =================================================================================== -->
<sdf version="1.5">
<sdf version="1.6">
<world name="default">
<physics type="ode">
<max_step_size>0.001</max_step_size>
Expand Down

0 comments on commit 249929f

Please sign in to comment.